1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/lib/payload.ld Mon Oct 22 21:44:02 2018 +0200
1.3 @@ -0,0 +1,70 @@
1.4 +OUTPUT_ARCH(mips)
1.5 +ENTRY(_start)
1.6 +
1.7 +IRQ_STACK_SIZE = 256;
1.8 +
1.9 +/* See...
1.10 + * FIGURE 4-5: MEMORY MAP ON RESET FOR PIC32MX170/270 DEVICES (64 KB RAM, 256 KB FLASH)
1.11 + * PIC32MX1XX/2XX 28/36/44-pin Family Data Sheet
1.12 + */
1.13 +
1.14 +MEMORY
1.15 +{
1.16 + kseg0_boot_mem (rx) : ORIGIN = 0x9FC00000, LENGTH = 0xBF0
1.17 + kseg0_program_mem (rx) : ORIGIN = 0x9D000000, LENGTH = 0x40000
1.18 + kseg0_data_mem (w!x) : ORIGIN = 0x80000000, LENGTH = 0x10000
1.19 + physical_boot_mem (rx) : ORIGIN = 0x1FC00000, LENGTH = 0xBF0
1.20 + physical_program_mem (rx) : ORIGIN = 0x1D000000, LENGTH = 0x40000
1.21 + physical_data_mem (w!x) : ORIGIN = 0x00000000, LENGTH = 0x10000
1.22 + sfrs : ORIGIN = 0xBF800000, LENGTH = 0x100000
1.23 + configsfrs : ORIGIN = 0xBFC00BF0, LENGTH = 0x10
1.24 + config3 : ORIGIN = 0xBFC00BF0, LENGTH = 0x4
1.25 + config2 : ORIGIN = 0xBFC00BF4, LENGTH = 0x4
1.26 + config1 : ORIGIN = 0xBFC00BF8, LENGTH = 0x4
1.27 + config0 : ORIGIN = 0xBFC00BFC, LENGTH = 0x4
1.28 + physical_config3 : ORIGIN = 0x3FC00BF0, LENGTH = 0x4
1.29 + physical_config2 : ORIGIN = 0x3FC00BF4, LENGTH = 0x4
1.30 + physical_config1 : ORIGIN = 0x3FC00BF8, LENGTH = 0x4
1.31 + physical_config0 : ORIGIN = 0x3FC00BFC, LENGTH = 0x4
1.32 +}
1.33 +
1.34 +SECTIONS
1.35 +{
1.36 + /* Boot program. */
1.37 +
1.38 + .boot : { *(.boot*) } > kseg0_boot_mem AT > physical_boot_mem
1.39 +
1.40 + /* Exception/interrupt vectors and general program code. */
1.41 +
1.42 + .vectors : { *(.vectors*) } > kseg0_program_mem AT > physical_program_mem
1.43 + .text : { *(.text*) } > kseg0_program_mem AT > physical_program_mem
1.44 +
1.45 + /* Reserve space at the bottom of RAM for the IRQ stack. */
1.46 +
1.47 + .irqstack : {
1.48 + . += IRQ_STACK_SIZE;
1.49 + } > kseg0_data_mem AT > physical_data_mem
1.50 +
1.51 + /* Add other data after the IRQ stack. */
1.52 +
1.53 + .bss : { *(.bss*) } > kseg0_data_mem AT > physical_data_mem
1.54 + .data : { *(.data*) } > kseg0_data_mem AT > physical_data_mem
1.55 +
1.56 + /* Store constant data in program memory. */
1.57 +
1.58 + .rodata : { *(.rodata*) } > kseg0_program_mem AT > physical_program_mem
1.59 + .got : {
1.60 + _gp = ALIGN(16);
1.61 + *(.got*)
1.62 + } > kseg0_program_mem AT > physical_program_mem
1.63 +
1.64 + /* Device configuration registers to be flashed. */
1.65 +
1.66 + .devcfg0 : { *(.devcfg0) } > config0 AT > physical_config0
1.67 + .devcfg1 : { *(.devcfg1) } > config1 AT > physical_config1
1.68 + .devcfg2 : { *(.devcfg2) } > config2 AT > physical_config2
1.69 +
1.70 + /* Discard things that might overwrite useful data. */
1.71 +
1.72 + /DISCARD/ : { *(.reginfo) *(.MIPS.abiflags) *(.pdr) *(.gnu.attributes) *(.comment) }
1.73 +}