Message ID | CAFR_W8q+A+V3RyUGO-cNqqYLnzOA_jJaj-eMiYFbtJcN5uN=Dg@mail.gmail.com |
---|---|
State | Deferred, archived |
Headers | show |
Hello, > OK, so I actually tried this and it works! I did it on my branch > so that I can just quickly give it a try and don't really have time > to prepare proper patch today (this being Friday and all), but this > is the summary of required changes: (the patch is also attached, > just in case, but you won't be able to apply it) nice one :) but do we need any of this if we are to remove lowlevel_init ? > --- a/include/configs/ast-common.h > +++ b/include/configs/ast-common.h > @@ -33,10 +33,10 @@ > #define CONFIG_SYS_DCACHE_OFF1 > > // Config changes -- this is the most important part. U-Boot will use these to setup stack and heap for us. > > #define CONFIG_SYS_SDRAM_BASEAST_DRAM_BASE > -#define CONFIG_SYS_INIT_RAM_ADDRCONFIG_SYS_SDRAM_BASE > -#define CONFIG_SYS_INIT_RAM_SIZE(32*1024) > +#define CONFIG_SYS_INIT_RAM_ADDR(AST_SRAM_BASE) > +#define CONFIG_SYS_INIT_RAM_SIZE(36*1024) > #define CONFIG_SYS_INIT_RAM_END(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE) > -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_END - GENERATED_GBL_DATA_SIZE) > +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_END) That is a fix I have included in my branch. Thanks, C. [ is it possible to configure gmail to wrap lines at a reasonable width ? ]
On Sun, Nov 6, 2016 at 9:18 PM, Cédric Le Goater <clg@kaod.org> wrote: > > Hello, > > > OK, so I actually tried this and it works! I did it on my branch > > so that I can just quickly give it a try and don't really have time > > to prepare proper patch today (this being Friday and all), but this > > is the summary of required changes: (the patch is also attached, > > just in case, but you won't be able to apply it) > > nice one :) > > but do we need any of this if we are to remove lowlevel_init ? The most important part is setting up the stack, which is basically configuration of CONFIG_SYS_INIT_RAM_* and CONFIG_SYS_INIT_SP_* This part is needed for the code that is going to end up being called from board_init_f function, which includes dram_init and early serial console init. > > > > --- a/include/configs/ast-common.h > > +++ b/include/configs/ast-common.h > > @@ -33,10 +33,10 @@ > > #define CONFIG_SYS_DCACHE_OFF1 > > > > // Config changes -- this is the most important part. U-Boot will use these to setup stack and heap for us. > > > > #define CONFIG_SYS_SDRAM_BASEAST_DRAM_BASE > > -#define CONFIG_SYS_INIT_RAM_ADDRCONFIG_SYS_SDRAM_BASE > > -#define CONFIG_SYS_INIT_RAM_SIZE(32*1024) > > +#define CONFIG_SYS_INIT_RAM_ADDR(AST_SRAM_BASE) > > +#define CONFIG_SYS_INIT_RAM_SIZE(36*1024) > > #define CONFIG_SYS_INIT_RAM_END(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE) > > -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_END - GENERATED_GBL_DATA_SIZE) > > +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_END) You will also need #define CONFIG_SYS_INIT_SP_OFFSET (GENERATED_GBL_DATA_SIZE) or just leave CONFIG_SYS_INIT_SP_ADDR defined as it is, but I guess that's less idiomatic. > > > That is a fix I have included in my branch. > > Thanks, > > C. > > [ is it possible to configure gmail to wrap lines at a reasonable > width ? ] > This is just a difference between plain text mode & "Rich Text" mode. This one should be wrapped normally (that is, if you trust the documentation).
commit 5e08b6fc8b72f8240373e15f828279db27cb06ff Author: Maxim Sloyko <maxims@google.com> Date: Fri Nov 4 16:23:28 2016 -0700 How to move lowlevel_init to board_early_init_f diff --git a/arch/arm/mach-aspeed/platform_g5.S b/arch/arm/mach-aspeed/platform_g5.S index c810f44..6f72f1c 100644 --- a/arch/arm/mach-aspeed/platform_g5.S +++ b/arch/arm/mach-aspeed/platform_g5.S @@ -242,12 +242,12 @@ TIME_TABLE_DDR4_1600: Calibration Macro End ******************************************************************************/ -.globl lowlevel_init -lowlevel_init: +.globl board_early_init_f +board_early_init_f: init_dram: /* save lr */ - mov r4, lr + push {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, lr} /* Clear AHB bus lock condition */ ldr r0, =0x1e600000 @@ -1991,9 +1991,6 @@ set_D2PLL: ldr r1, =0xEA str r1, [r0] - /* restore lr */ - mov lr, r4 - - /* back to arch calling code */ - mov pc, lr + mov r0, #0 + pop {r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, pc} diff --git a/board/aspeed/zaius-bmc/zaius-bmc.c b/board/aspeed/zaius-bmc/zaius-bmc.c index 04909d1..0052767 100644 --- a/board/aspeed/zaius-bmc/zaius-bmc.c +++ b/board/aspeed/zaius-bmc/zaius-bmc.c @@ -56,6 +56,8 @@ void show_boot_progress(int progress) } #endif +void lowlevel_init() {} + int board_init(void) { /* adress of boot parameters */ diff --git a/include/configs/ast-common.h b/include/configs/ast-common.h index 0c7d8fe..b9c87d6 100644 --- a/include/configs/ast-common.h +++ b/include/configs/ast-common.h @@ -33,10 +33,10 @@ #define CONFIG_SYS_DCACHE_OFF 1 #define CONFIG_SYS_SDRAM_BASE AST_DRAM_BASE -#define CONFIG_SYS_INIT_RAM_ADDR CONFIG_SYS_SDRAM_BASE -#define CONFIG_SYS_INIT_RAM_SIZE (32*1024) +#define CONFIG_SYS_INIT_RAM_ADDR (AST_SRAM_BASE) +#define CONFIG_SYS_INIT_RAM_SIZE (36*1024) #define CONFIG_SYS_INIT_RAM_END (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_RAM_SIZE) -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_END - GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_INIT_RAM_END) #define CONFIG_NR_DRAM_BANKS 1 diff --git a/include/configs/zaius-bmc.h b/include/configs/zaius-bmc.h index cf4b1ff..65a76fb 100644 --- a/include/configs/zaius-bmc.h +++ b/include/configs/zaius-bmc.h @@ -36,6 +36,9 @@ #define CONFIG_EEPROM_I2C_ADDR (0x50) #define CONFIG_ID_EEPROM +#define CONFIG_SYS_INIT_SP_OFFSET (CONFIG_SYS_GBL_DATA_OFFSET) +#define CONFIG_BOARD_EARLY_INIT_F + /* platform.S settings */ #define CONFIG_DRAM_ECC #define CONFIG_DRAM_ECC_SIZE 0x20000000