From 659c244a0b67f2a5020869aa97fd87be33cfe429 Mon Sep 17 00:00:00 2001 From: Mateusz Holenko Date: Mon, 17 Feb 2020 16:52:08 +0100 Subject: [PATCH] bios/boot: allow to customize flash offsets of Linux images --- litex/soc/software/bios/boot.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/litex/soc/software/bios/boot.c b/litex/soc/software/bios/boot.c index 6a828506..f49d89e4 100644 --- a/litex/soc/software/bios/boot.c +++ b/litex/soc/software/bios/boot.c @@ -409,10 +409,18 @@ static int copy_image_from_flash_to_ram(unsigned int flash_address, unsigned int } #endif -#define KERNEL_IMAGE_FLASH_OFFSET 0x00000000 // 0MB -#define ROOTFS_IMAGE_FLASH_OFFSET 0x00500000 // 5MB -#define DEVICE_TREE_IMAGE_FLASH_OFFSET 0x00D00000 // 13MB -#define EMULATOR_IMAGE_FLASH_OFFSET 0x00E00000 // 14MB +#ifndef KERNEL_IMAGE_FLASH_OFFSET + #define KERNEL_IMAGE_FLASH_OFFSET 0x00000000 // 0MB +#endif +#ifndef ROOTFS_IMAGE_FLASH_OFFSET + #define ROOTFS_IMAGE_FLASH_OFFSET 0x00500000 // 5MB +#endif +#ifndef DEVICE_TREE_IMAGE_FLASH_OFFSET + #define DEVICE_TREE_IMAGE_FLASH_OFFSET 0x00D00000 // 13MB +#endif +#ifndef EMULATOR_IMAGE_FLASH_OFFSET + #define EMULATOR_IMAGE_FLASH_OFFSET 0x00E00000 // 14MB +#endif void flashboot(void) { -- 2.30.2