Add ability for arch code to make changes before we boot
PATCH 1/1 Add ability for arch code to make changes before we boot
Added a arch_preboot() function that cpu specific code can implement to allow for various modifications to the state of the machine right before we boot. This can be useful to setup register state to a specific configuration.
--- common/cmd_bootm.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
common/cmd_bootm.c +10 -0
@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) }void arch_lmb_reserve (struct lmb *lmb) __attribute__((weak,alias ("__arch_lmb_reserve" ))); +/* Allow for arch specific config before we boot */ +void __arch_preboot (void ) +{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +#if defined(__ARM__)#define IH_INITRD_ARCH IH_ARCH_ARM#elif defined(__avr32__)
@@ -543,6 +550,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])break ;case BOOTM_STATE_OS_GO :disable_interrupts (); +arch_preboot ();boot_fn (BOOTM_STATE_OS_GO , argc, argv, &images);break ; }
@@ -673,6 +681,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])return 1 ; } +arch_preboot (); +boot_fn (0 , argc, argv, &images);show_boot_progress (-9 );
Signature · 1 line
1.6.0.6
PATCH 1/1 85xx: Add support for setting IVORs to fixed offset defaults
In future Book-E implementations IVORs will most likely go away and be replaced with fixed offsets. The IVPR will continue to exist to allow for relocation of the interrupt vectors.
This code adds support to setup the IVORs as their fixed offset values per the ISA 2.06 spec when we transition from u-boot to another OS either via 'bootm' or a cpu release.
--- cpu/mpc85xx/cpu_init.c | 7 ++++ cpu/mpc85xx/fixed_ivor.S | 79 +++++++++++++++++++++++++++++++++++++++++++ cpu/mpc85xx/release.S | 3 ++ cpu/mpc85xx/start.S | 6 +++ include/asm-ppc/processor.h | 12 ++++++ 5 files changed, 107 insertions(+), 0 deletions(-) create mode 100644 cpu/mpc85xx/fixed_ivor.S
cpu/mpc85xx/cpu_init.c +7 -0
@@ -374,3 +374,10 @@ int cpu_init_r(void)#endif return 0 ; } + +extern void setup_ivors (void ); + +void arch_preboot (void ) +{ +setup_ivors (); +}
cpu/mpc85xx/fixed_ivor.S new file +79 -0
79 lines not on this page · raw message
cpu/mpc85xx/release.S +3 -0
@@ -167,6 +167,9 @@ __secondary_start_page: andi. r11,r4,1 bne 2b isync + + /* setup IVORs to match fixed offsets */ +#include "fixed_ivor.S" /* get the upper bits of the addr */ lwz r11,ENTRY_ADDR_UPPER(r10)
cpu/mpc85xx/start.S +6 -0
@@ -1122,3 +1122,9 @@ flush_dcache: isync blr + +.globl setup_ivors +setup_ivors: + +#include "fixed_ivor.S" + blr
include/asm-ppc/processor.h +12 -0
@@ -468,6 +468,16 @@#define SPRN_IVOR13 0x19d/* Interrupt Vector Offset Register 13 */ #define SPRN_IVOR14 0x19e/* Interrupt Vector Offset Register 14 */ #define SPRN_IVOR15 0x19f/* Interrupt Vector Offset Register 15 */ +#define SPRN_IVOR38 0x1b0/* Interrupt Vector Offset Register 38 */ +#define SPRN_IVOR39 0x1b1/* Interrupt Vector Offset Register 39 */ +#define SPRN_IVOR40 0x1b2/* Interrupt Vector Offset Register 40 */ +#define SPRN_IVOR41 0x1b3/* Interrupt Vector Offset Register 41 */ +#define SPRN_GIVOR2 0x1b8/* Guest Interrupt Vector Offset Register 2 */ +#define SPRN_GIVOR3 0x1b9/* Guest Interrupt Vector Offset Register 3 */ +#define SPRN_GIVOR4 0x1ba/* Guest Interrupt Vector Offset Register 4 */ +#define SPRN_GIVOR8 0x1bb/* Guest Interrupt Vector Offset Register 8 */ +#define SPRN_GIVOR13 0x1bc/* Guest Interrupt Vector Offset Register 13 */ +#define SPRN_GIVOR14 0x1bd/* Guest Interrupt Vector Offset Register 14 */ /* e500 definitions */ #define SPRN_L1CFG0 0x203/* L1 Cache Configuration Register 0 */
@@ -513,6 +523,8 @@#define SPRN_IVOR33 0x211/* Interrupt Vector Offset Register 33 */ #define SPRN_IVOR34 0x212/* Interrupt Vector Offset Register 34 */ #define SPRN_IVOR35 0x213/* Interrupt Vector Offset Register 35 */ +#define SPRN_IVOR36 0x214/* Interrupt Vector Offset Register 36 */ +#define SPRN_IVOR37 0x215/* Interrupt Vector Offset Register 37 */ #define SPRN_SPEFSCR 0x200/* SPE & Embedded FP Status & Control */ #define SPRN_MCSRR0 0x23a/* Machine Check Save and Restore Register 0 */
Signature · 1 line
1.6.0.6
PATCH 1/1 Add ability for arch code to make changes before we boot
In reply to Kumar GalaQuoted 11 lines · Kumar Gala
Added a
arch_preboot()function that cpu specific code can implement to
allow for various modifications to the state of the machine right before
we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>---
common/cmd_bootm.c| 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)
If you can review and ack this if its ok that would be great. I'd like to send this via the 85xx next tree as the patch for fixed IVORs depends on it.
- k
Quoted 47 lines
common/cmd_bootm.c +7
-0@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) }void arch_lmb_reserve (struct lmb *lmb) __attribute__((weak,alias ("__arch_lmb_reserve" ))); +/* Allow for arch specific config before we boot */ +void __arch_preboot (void ) +{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +#if defined(__ARM__)#define
IH_INITRD_ARCHIH_ARCH_ARM
#elifdefined(__avr32__)common/cmd_bootm.c +1
-0@@ -543,6 +550,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])break ;case BOOTM_STATE_OS_GO :disable_interrupts (); +arch_preboot ();boot_fn (BOOTM_STATE_OS_GO , argc, argv, &images);break ;}common/cmd_bootm.c +2
-0@@ -673,6 +681,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; } +arch_preboot (); +boot_fn (0 , argc, argv, &images);show_boot_progress (-9);Signature · 6 lines
1.6.0.6 _______________________________________________ U-Boot mailing list U-Boot at lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
PATCH 1/1 Add ability for arch code to make changes before we boot
In reply to Kumar GalaQuoted 15 lines · Kumar Gala
Added a
arch_preboot()function that cpu specific code can implement to allow for various modifications to the state of the machine right before we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>--- common/cmd_bootm.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)common/cmd_bootm.c +0
-0
common/cmd_bootm.c void __arch_lmb_reserve(struct lmb *lmb) · line 175
Quoted 10 lines
common/cmd_bootm.c +7
-0@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) }void arch_lmb_reserve (struct lmb *lmb) __attribute__((weak,alias ("__arch_lmb_reserve" ))); +/* Allow for arch specific config before we boot */ +void __arch_preboot (void ) +{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +
why not a section so you will be able to have multiple callback so it can be arch or soc or board too in any combination
Best Regards,
J.
PATCH 1/1 Add ability for arch code to make changes before we boot
Quoted 22 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 21 lines · Kumar Gala
Added a
arch_preboot()function that cpu specific code can implement to
allow for various modifications to the state of the machine right before
we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>---
common/cmd_bootm.c| 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)common/cmd_bootm.c +0
-0@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) }void arch_lmb_reserve (struct lmb *lmb) __attribute__((weak,alias ("__arch_lmb_reserve" )));
Quoted 11 lines
common/cmd_bootm.c void __arch_lmb_reserve(struct lmb *lmb) · line 175
Quoted 8 lines
common/cmd_bootm.c +7
-0+/* Allow for arch specific config before we boot */ +void __arch_preboot (void ) +{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +why not a section so you will be able to have multiple callback so it can be
arch or soc or board too in any combination
Because the use I have for it is a simple single case at this point.
If and when we need more complexity we can add it.
- k
PATCH 1/1 Add ability for arch code to make changes before we boot
Quoted 37 lines · Kumar Gala
Quoted 22 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 21 lines · Kumar Gala
Added a
arch_preboot()function that cpu specific code can implement to
allow for various modifications to the state of the machine right before
we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>---
common/cmd_bootm.c| 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)common/cmd_bootm.c +0
-0@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) }void arch_lmb_reserve (struct lmb *lmb) __attribute__((weak,alias ("__arch_lmb_reserve" )));Quoted 11 lines
common/cmd_bootm.c void __arch_lmb_reserve(struct lmb *lmb) · line 175
Quoted 8 lines
common/cmd_bootm.c +7
-0+/* Allow for arch specific config before we boot */ +void __arch_preboot (void ) +{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +why not a section so you will be able to have multiple callback so it can be
arch or soc or board too in any combination
Quoted 3 lines
Because the use I have for it is a simple single case at this point.
If and when we need more complexity we can add it.
we have already it
as example the usb drivers that need to be stop before start an os I forget some but I'm sure to have seen oher
Best Regards,
J.
PATCH 1/1 Add ability for arch code to make changes before we boot
Quoted 38 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 37 lines · Kumar Gala
Quoted 33 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 19 lines · Kumar Gala
Added a
arch_preboot()function that cpu specific code can implement to
allow for various modifications to the state of the machine right before
we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>---
common/cmd_bootm.c| 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)common/cmd_bootm.c +0
-0@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) } void arch_lmb_reserve(struct lmb *lmb) __attribute__((weak,common/cmd_bootm.c void __arch_lmb_reserve(struct lmb *lmb) · line 177
Quoted 10 lines
common/cmd_bootm.c +7
-0alias("__arch_lmb_reserve"))); +/* Allow for arch specific config before we boot */ +void __arch_preboot (void ) +{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +why not a section so you will be able to have multiple callback so it can be
arch or soc or board too in any combination
Quoted 6 lines
Quoted 3 lines
Because the use I have for it is a simple single case at this point.
If and when we need more complexity we can add it.
we have already it
as example the usb drivers that need to be stop before start an os I forget some but I'm sure to have seen oher
We already handle USB in the bootm code. I don't see any reason to go add a bunch of code for the one case we handle.
- k
PATCH 1/1 Add ability for arch code to make changes before we boot
In reply to Kumar GalaQuoted 11 lines · Kumar Gala
Added a
arch_preboot()function that cpu specific code can implement to
allow for various modifications to the state of the machine right before
we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>---
common/cmd_bootm.c| 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)
Wolfgang,
Can you look at either commenting on this or picking it up for 'next'. Its one patch the current '85xx next' tree depends on.
- k
PATCH 1/1 Add ability for arch code to make changes before we boot
In reply to Kumar GalaDear Kumar Gala,
Quoted 15 lines · In message <[email protected]> you…
Added a
arch_preboot()function that cpu specific code can implement to allow for various modifications to the state of the machine right before we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>--- common/cmd_bootm.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)common/cmd_bootm.c +0
-0
common/cmd_bootm.c void __arch_lmb_reserve(struct lmb *lmb) · line 170
Quoted 5 lines
common/cmd_bootm.c +2
-0@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) }void arch_lmb_reserve (struct lmb *lmb) __attribute__((weak,alias ("__arch_lmb_reserve" ))); +/* Allow for arch specific config before we boot */ +void __arch_preboot (void )
As this is only used when booting an OS (and not for example when starting a standalone program) we should probably write:
/* Allow for arch specific code before booting the OS */ void __arch_preboot_os() ...
common/cmd_bootm.c int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 551
Quoted 11 lines
common/cmd_bootm.c +5
-0+{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +#if defined(__ARM__)#define IH_INITRD_ARCH IH_ARCH_ARM#elif defined(__avr32__)@@ -543,6 +550,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])break ;case BOOTM_STATE_OS_GO :
Hm... maybe this could / should be handled in BOOTM_STATE_OS_PREP state?
common/cmd_bootm.c int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 553
Quoted 2 lines
common/cmd_bootm.c +1
-0disable_interrupts (); +arch_preboot ();
And maybe we should mode disable_interrupts() into the default implementation of arch_preboot_os() ?
common/cmd_bootm.c int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 686
Quoted 10 lines
common/cmd_bootm.c +2
-0boot_fn (BOOTM_STATE_OS_GO , argc, argv, &images);break ; }@@ -673,6 +681,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])return 1 ; } +arch_preboot (); +boot_fn (0 , argc, argv, &images);
But this would change behaviour here. Eventually to the better?
Best regards,
Wolfgang Denk
Signature · 7 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de Niklaus Wirth has lamented that, whereas Europeans pronounce his name correctly (Ni-klows Virt), Americans invariably mangle it into (Nick-les Worth). Which is to say that Europeans call him by name, but Americans call him by value.
PATCH 1/1 Add ability for arch code to make changes before we boot
Quoted 31 lines · Wolfgang Denk
Dear Kumar Gala,
In message <[email protected]
Quoted 18 lines
you wrote:
Added aarch_preboot()function that cpu specific code can implement to
allow for various modifications to the state of the machine right before
we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>---
common/cmd_bootm.c| 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)common/cmd_bootm.c +0
-0common/cmd_bootm.c void __arch_lmb_reserve(struct lmb *lmb) · line 171
Quoted 6 lines
common/cmd_bootm.c +2
-0@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) }void arch_lmb_reserve (struct lmb *lmb) __attribute__((weak,alias ("__arch_lmb_reserve" ))); +/* Allow for arch specific config before we boot */ +void __arch_preboot (void )As this is only used when booting an OS (and not for example when starting a standalone program) we should probably write:
Quoted 3 lines
/* Allow for arch specific code before booting the OS */ void __arch_preboot_os() ...
no problem, will change the name.
Quoted 8 lines
Quoted 8 lines
common/cmd_bootm.c +5
-0+{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +#if defined(__ARM__)#define IH_INITRD_ARCH IH_ARCH_ARM
Quoted 8 lines
common/cmd_bootm.c int do_bootm_subcommand (cmd_tbl_t *cmdtp, int · line 552
Quoted 5 lines
#elif
defined(__avr32__)common/cmd_bootm.c +0
-0@@ -543,6 +550,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])break ;case BOOTM_STATE_OS_GO :Hm... maybe this could / should be handled in
BOOTM_STATE_OS_PREPstate?
I'd prefer to keep arch_preboot_os() as close to boot_fn() as possible
Quoted 5 lines
common/cmd_bootm.c int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 553
Quoted 2 lines
common/cmd_bootm.c +1
-0disable_interrupts (); +arch_preboot ();And maybe we should mode
disable_interrupts()into the default implementation ofarch_preboot_os()?
Got no issue with moving disable_interrupts into the default implementation of arch_preboot_os()
Quoted 10 lines
Quoted 10 lines
common/cmd_bootm.c +0
-0boot_fn (BOOTM_STATE_OS_GO , argc, argv, &images);break ;}common/cmd_bootm.c +0
-0@@ -673,6 +681,8 @@ int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) return 1; }
Quoted 5 lines
common/cmd_bootm.c int do_bootm (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 686
Quoted 3 lines
common/cmd_bootm.c +2
-0+arch_preboot (); +boot_fn (0 , argc, argv, &images);But this would change behaviour here. Eventually to the better?
Not sure if I see how this would be better (or worse for that matter).
- k
PATCH 1/1 Add ability for arch code to make changes before we boot
Quoted 59 lines · Kumar Gala
Quoted 31 lines · Wolfgang Denk
Dear Kumar Gala,
In message <[email protected]
Quoted 18 lines
you wrote:
Added aarch_preboot()function that cpu specific code can implement to
allow for various modifications to the state of the machine right before
we boot. This can be useful to setup register state to a specific configuration.Signed-off-by Kumar Gala <[email protected]>---
common/cmd_bootm.c| 10 ++++++++++1 files changed, 10 insertions(+), 0 deletions(-)common/cmd_bootm.c +0
-0common/cmd_bootm.c void __arch_lmb_reserve(struct lmb *lmb) · line 171
Quoted 6 lines
common/cmd_bootm.c +2
-0@@ -166,6 +166,13 @@ void __arch_lmb_reserve(struct lmb *lmb) }void arch_lmb_reserve (struct lmb *lmb) __attribute__((weak,alias ("__arch_lmb_reserve" ))); +/* Allow for arch specific config before we boot */ +void __arch_preboot (void )As this is only used when booting an OS (and not for example when starting a standalone program) we should probably write:
Quoted 3 lines
/* Allow for arch specific code before booting the OS */ void __arch_preboot_os() ...no problem, will change the name.
Quoted 8 lines
Quoted 8 lines
common/cmd_bootm.c +5
-0+{ +/* please define platform specific arch_preboot() */ +} +void arch_preboot (void ) __attribute__((weak,alias ("__arch_preboot" ))); +#if defined(__ARM__)#define
IH_INITRD_ARCHIH_ARCH_ARMQuoted 8 lines
common/cmd_bootm.c int do_bootm_subcommand (cmd_tbl_t *cmdtp, int · line 552
Quoted 5 lines
#elif
defined(__avr32__)common/cmd_bootm.c +0
-0@@ -543,6 +550,7 @@ int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])break ;case BOOTM_STATE_OS_GO :Hm... maybe this could / should be handled in
BOOTM_STATE_OS_PREPstate?I'd prefer to keep
arch_preboot_os()as close toboot_fn()as possible
Quoted 8 lines
Quoted 5 lines
common/cmd_bootm.c int do_bootm_subcommand (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) · line 553
Quoted 2 lines
common/cmd_bootm.c +1
-0disable_interrupts (); +arch_preboot ();And maybe we should mode
disable_interrupts()into the default implementation ofarch_preboot_os()?Got no issue with moving
disable_interruptsinto the default implementation ofarch_preboot_os()
Now that I look at how do_bootm() calls and uses disable_interrupts() this is a bit more tricky. I'd prefer to leave disable_interrupts() alone.
- k