[U-Boot] [PATCH 1/8] microblaze: Make room for malloc before ELF

Create space below u-boot binary for early malloc. It means memory layout is stack grows down, space for early malloc, u-boot code.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
include/configs/microblaze-generic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 06f6ed1fc0c2..a48c8d60948e 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -121,7 +121,8 @@ #endif
/* Stack location before relocation */ -#define CONFIG_SYS_INIT_SP_OFFSET CONFIG_SYS_TEXT_BASE +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \ + CONFIG_SYS_MALLOC_F_LEN)
/* * CFI flash memory layout - Example

Clean board specific file.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
configs/microblaze-generic_defconfig | 2 ++ include/configs/microblaze-generic.h | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/configs/microblaze-generic_defconfig b/configs/microblaze-generic_defconfig index 1fe2e0fed37f..98391c8c6d4d 100644 --- a/configs/microblaze-generic_defconfig +++ b/configs/microblaze-generic_defconfig @@ -1,4 +1,6 @@ CONFIG_MICROBLAZE=y +CONFIG_SYS_MALLOC_F=y +CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_TARGET_MICROBLAZE_GENERIC=y CONFIG_DEFAULT_DEVICE_TREE="microblaze-generic" CONFIG_SPL=y diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index a48c8d60948e..e0bc41c874a1 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -113,12 +113,6 @@ #endif
#define CONFIG_SYS_MALLOC_LEN 0xC0000 -#ifndef CONFIG_SPL_BUILD -# define CONFIG_SYS_MALLOC_F_LEN 1024 -#else -# define CONFIG_SYS_MALLOC_SIMPLE -# define CONFIG_SYS_MALLOC_F_LEN 0x150 -#endif
/* Stack location before relocation */ #define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_TEXT_BASE - \

On 11 December 2015 at 04:48, Michal Simek michal.simek@xilinx.com wrote:
Clean board specific file.
Signed-off-by: Michal Simek michal.simek@xilinx.com
configs/microblaze-generic_defconfig | 2 ++ include/configs/microblaze-generic.h | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-)
Reviewed-by: Simon Glass sjg@chromium.org

LL_TEMAC is available at big endian MB and it is not properly tested that's why the patch removes it.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
.../xilinx/microblaze-generic/microblaze-generic.c | 35 ---------------------- board/xilinx/microblaze-generic/xparameters.h | 6 ---- include/configs/microblaze-generic.h | 6 +--- 3 files changed, 1 insertion(+), 46 deletions(-)
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index 0c8bd7d1511e..bc4d6414df2d 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -122,40 +122,5 @@ int board_eth_init(bd_t *bis) txpp, rxpp); #endif
-#ifdef CONFIG_XILINX_LL_TEMAC -# ifdef XILINX_LLTEMAC_BASEADDR -# ifdef XILINX_LLTEMAC_FIFO_BASEADDR - ret |= xilinx_ll_temac_eth_init(bis, XILINX_LLTEMAC_BASEADDR, - XILINX_LL_TEMAC_M_FIFO, XILINX_LLTEMAC_FIFO_BASEADDR); -# elif XILINX_LLTEMAC_SDMA_CTRL_BASEADDR -# if XILINX_LLTEMAC_SDMA_USE_DCR == 1 - ret |= xilinx_ll_temac_eth_init(bis, XILINX_LLTEMAC_BASEADDR, - XILINX_LL_TEMAC_M_SDMA_DCR, - XILINX_LLTEMAC_SDMA_CTRL_BASEADDR); -# else - ret |= xilinx_ll_temac_eth_init(bis, XILINX_LLTEMAC_BASEADDR, - XILINX_LL_TEMAC_M_SDMA_PLB, - XILINX_LLTEMAC_SDMA_CTRL_BASEADDR); -# endif -# endif -# endif -# ifdef XILINX_LLTEMAC_BASEADDR1 -# ifdef XILINX_LLTEMAC_FIFO_BASEADDR1 - ret |= xilinx_ll_temac_eth_init(bis, XILINX_LLTEMAC_BASEADDR1, - XILINX_LL_TEMAC_M_FIFO, XILINX_LLTEMAC_FIFO_BASEADDR1); -# elif XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1 -# if XILINX_LLTEMAC_SDMA_USE_DCR == 1 - ret |= xilinx_ll_temac_eth_init(bis, XILINX_LLTEMAC_BASEADDR1, - XILINX_LL_TEMAC_M_SDMA_DCR, - XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1); -# else - ret |= xilinx_ll_temac_eth_init(bis, XILINX_LLTEMAC_BASEADDR1, - XILINX_LL_TEMAC_M_SDMA_PLB, - XILINX_LLTEMAC_SDMA_CTRL_BASEADDR1); -# endif -# endif -# endif -#endif - return ret; } diff --git a/board/xilinx/microblaze-generic/xparameters.h b/board/xilinx/microblaze-generic/xparameters.h index d6d0d679e8e0..8ba146cb88db 100644 --- a/board/xilinx/microblaze-generic/xparameters.h +++ b/board/xilinx/microblaze-generic/xparameters.h @@ -56,12 +56,6 @@ /* Ethernet controller is Ethernet_MAC */ #define XILINX_EMACLITE_BASEADDR 0x40C00000
-/* LL_TEMAC Ethernet controller */ -#define XILINX_LLTEMAC_BASEADDR 0x44000000 -#define XILINX_LLTEMAC_SDMA_CTRL_BASEADDR 0x42000180 -#define XILINX_LLTEMAC_BASEADDR1 0x44200000 -#define XILINX_LLTEMAC_FIFO_BASEADDR1 0x42100000 - /* Watchdog IP is wxi_timebase_wdt_0 */ #define XILINX_WATCHDOG_BASEADDR 0x50000000 #define XILINX_WATCHDOG_IRQ 1 diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index e0bc41c874a1..8db6b551ceda 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -68,10 +68,6 @@ # define CONFIG_XILINX_EMACLITE 1 # define CONFIG_SYS_ENET #endif -#if defined(XILINX_LLTEMAC_BASEADDR) -# define CONFIG_XILINX_LL_TEMAC 1 -# define CONFIG_SYS_ENET -#endif #if defined(XILINX_AXIEMAC_BASEADDR) # define CONFIG_XILINX_AXIEMAC 1 # define CONFIG_SYS_ENET @@ -355,7 +351,7 @@ #define CONFIG_FIT 1 #define CONFIG_OF_LIBFDT 1
-#if defined(CONFIG_XILINX_LL_TEMAC) || defined(CONFIG_XILINX_AXIEMAC) +#if defined(CONFIG_XILINX_AXIEMAC) # define CONFIG_MII 1 # define CONFIG_CMD_MII 1 # define CONFIG_PHY_GIGE 1

Signed-off-by: Michal Simek michal.simek@xilinx.com ---
arch/microblaze/Kconfig | 1 + configs/microblaze-generic_defconfig | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index 077b2a7d5ec1..a730b72a52f3 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -11,6 +11,7 @@ choice config TARGET_MICROBLAZE_GENERIC bool "Support microblaze-generic" select SUPPORT_SPL + select OF_CONTROL
endchoice
diff --git a/configs/microblaze-generic_defconfig b/configs/microblaze-generic_defconfig index 98391c8c6d4d..c13efd091d61 100644 --- a/configs/microblaze-generic_defconfig +++ b/configs/microblaze-generic_defconfig @@ -7,5 +7,4 @@ CONFIG_SPL=y CONFIG_SYS_PROMPT="U-Boot-mONStR> " CONFIG_CMD_GPIO=y # CONFIG_CMD_SETEXPR is not set -CONFIG_OF_CONTROL=y CONFIG_OF_EMBED=y

Enable DM for the whole architecture.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
arch/microblaze/Kconfig | 1 + configs/microblaze-generic_defconfig | 1 - 2 files changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/microblaze/Kconfig b/arch/microblaze/Kconfig index a730b72a52f3..604f6815af5b 100644 --- a/arch/microblaze/Kconfig +++ b/arch/microblaze/Kconfig @@ -12,6 +12,7 @@ config TARGET_MICROBLAZE_GENERIC bool "Support microblaze-generic" select SUPPORT_SPL select OF_CONTROL + select DM
endchoice
diff --git a/configs/microblaze-generic_defconfig b/configs/microblaze-generic_defconfig index c13efd091d61..54aa3ef3d26f 100644 --- a/configs/microblaze-generic_defconfig +++ b/configs/microblaze-generic_defconfig @@ -1,5 +1,4 @@ CONFIG_MICROBLAZE=y -CONFIG_SYS_MALLOC_F=y CONFIG_SPL_SYS_MALLOC_SIMPLE=y CONFIG_TARGET_MICROBLAZE_GENERIC=y CONFIG_DEFAULT_DEVICE_TREE="microblaze-generic"

watchdog and gpio are not validated for SPL that's why do not use them.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
board/xilinx/microblaze-generic/microblaze-generic.c | 3 ++- include/configs/microblaze-generic.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index bc4d6414df2d..dfa629322223 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -69,6 +69,7 @@ int dram_init(void)
int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { +#ifndef CONFIG_SPL_BUILD #ifdef CONFIG_XILINX_GPIO if (reset_pin != -1) gpio_direction_output(reset_pin, 1); @@ -77,7 +78,7 @@ int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) #ifdef CONFIG_XILINX_TB_WATCHDOG hw_watchdog_disable(); #endif - +#endif puts ("Reseting board\n"); __asm__ __volatile__ (" mts rmsr, r0;" \ "bra r0"); diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 8db6b551ceda..f93861d770ee 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -97,8 +97,10 @@ #if defined(XILINX_WATCHDOG_BASEADDR) && defined(XILINX_WATCHDOG_IRQ) # define CONFIG_WATCHDOG_BASEADDR XILINX_WATCHDOG_BASEADDR # define CONFIG_WATCHDOG_IRQ XILINX_WATCHDOG_IRQ -# define CONFIG_HW_WATCHDOG -# define CONFIG_XILINX_TB_WATCHDOG +# ifndef CONFIG_SPL_BUILD +# define CONFIG_HW_WATCHDOG +# define CONFIG_XILINX_TB_WATCHDOG +# endif #endif
#if !defined(CONFIG_OF_CONTROL) || \

Take it from DT instead.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
include/configs/microblaze-generic.h | 2 -- 1 file changed, 2 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index f93861d770ee..64248a8c6182 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -37,7 +37,6 @@ # define CONFIG_SERIAL_BASE XILINX_UARTLITE_BASEADDR # define CONFIG_BAUDRATE XILINX_UARTLITE_BAUDRATE # define CONFIG_SYS_BAUDRATE_TABLE { CONFIG_BAUDRATE } -# define CONSOLE_ARG "console=console=ttyUL0,115200\0" #elif XILINX_UART16550_BASEADDR # define CONFIG_SYS_NS16550_SERIAL # if defined(__MICROBLAZEEL__) @@ -54,7 +53,6 @@ /* The following table includes the supported baudrates */ # define CONFIG_SYS_BAUDRATE_TABLE \ {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400} -# define CONSOLE_ARG "console=console=ttyS0,115200\0" #else # error Undefined uart #endif

Preparation of moving to DM. Uartlite ignores baudrate setting.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
include/configs/microblaze-generic.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/include/configs/microblaze-generic.h b/include/configs/microblaze-generic.h index 64248a8c6182..10ac8328b8ff 100644 --- a/include/configs/microblaze-generic.h +++ b/include/configs/microblaze-generic.h @@ -32,11 +32,14 @@ #endif
/* uart */ +# define CONFIG_BAUDRATE 115200 +/* The following table includes the supported baudrates */ +# define CONFIG_SYS_BAUDRATE_TABLE \ + {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400} + #ifdef XILINX_UARTLITE_BASEADDR # define CONFIG_XILINX_UARTLITE # define CONFIG_SERIAL_BASE XILINX_UARTLITE_BASEADDR -# define CONFIG_BAUDRATE XILINX_UARTLITE_BAUDRATE -# define CONFIG_SYS_BAUDRATE_TABLE { CONFIG_BAUDRATE } #elif XILINX_UART16550_BASEADDR # define CONFIG_SYS_NS16550_SERIAL # if defined(__MICROBLAZEEL__) @@ -48,11 +51,6 @@ # define CONFIG_SYS_NS16550_COM1 \ ((XILINX_UART16550_BASEADDR & ~0xF) + 0x1000) # define CONFIG_SYS_NS16550_CLK XILINX_UART16550_CLOCK_HZ -# define CONFIG_BAUDRATE 115200 - -/* The following table includes the supported baudrates */ -# define CONFIG_SYS_BAUDRATE_TABLE \ - {300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 230400} #else # error Undefined uart #endif
participants (2)
-
Michal Simek
-
Simon Glass