* Remove unused args in head_*
@ 2008-10-12 14:08 Sebastian Andrzej Siewior
2008-10-12 14:08 ` [PATCH 1/2] powerpc: don't pass unused regs around in head_.*.S Sebastian Andrzej Siewior
2008-10-12 14:08 ` [PATCH 2/2] powerpc: reflect the used arguments in machine_init() prototype Sebastian Andrzej Siewior
0 siblings, 2 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2008-10-12 14:08 UTC (permalink / raw)
To: linuxppc-dev
I've stumbled over these while I tried to figure out how the boot procedure
is working on powerpc. Right now (in powerpc) the comment seems to reflect
the code but not what is actually happening: regs r4-r7 aren't used and r3
is the device tree.
Sebastian
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] powerpc: don't pass unused regs around in head_.*.S
2008-10-12 14:08 Remove unused args in head_* Sebastian Andrzej Siewior
@ 2008-10-12 14:08 ` Sebastian Andrzej Siewior
2008-10-13 23:25 ` Benjamin Herrenschmidt
2008-10-12 14:08 ` [PATCH 2/2] powerpc: reflect the used arguments in machine_init() prototype Sebastian Andrzej Siewior
1 sibling, 1 reply; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2008-10-12 14:08 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Sebastian Andrzej Siewior
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
This looks like a relict from arch/ppc. machine_init() is accepting
only two parameters (dtb, phys) and is using only the first one.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/powerpc/kernel/head_32.S | 8 +-------
arch/powerpc/kernel/head_40x.S | 14 +-------------
arch/powerpc/kernel/head_44x.S | 14 +-------------
arch/powerpc/kernel/head_8xx.S | 14 +-------------
arch/powerpc/kernel/head_fsl_booke.S | 14 +-------------
5 files changed, 5 insertions(+), 59 deletions(-)
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S
index a6de6db..2f5c4fc 100644
--- a/arch/powerpc/kernel/head_32.S
+++ b/arch/powerpc/kernel/head_32.S
@@ -89,11 +89,7 @@ _ENTRY(_start);
* This is jumped to on prep systems right after the kernel is relocated
* to its proper place in memory by the boot loader. The expected layout
* of the regs is:
- * r3: ptr to residual data
- * r4: initrd_start or if no initrd then 0
- * r5: initrd_end - unused if r4 is 0
- * r6: Start of command line string
- * r7: End of command line string
+ * r3 - Device tree pointer (DRAM, frequency, MAC address, etc.)
*
* This just gets a minimal mmu environment setup so we can call
* start_here() to do the real work.
@@ -128,7 +124,6 @@ __start:
#endif /* CONFIG_PPC_PMAC */
1: mr r31,r3 /* save parameters */
- mr r30,r4
li r24,0 /* cpu # */
/*
@@ -1017,7 +1012,6 @@ start_here:
* and set up the MMU.
*/
mr r3,r31
- mr r4,r30
bl machine_init
bl __save_cpu_setup
bl MMU_init
diff --git a/arch/powerpc/kernel/head_40x.S b/arch/powerpc/kernel/head_40x.S
index 56d8e5d..1cdd4ce 100644
--- a/arch/powerpc/kernel/head_40x.S
+++ b/arch/powerpc/kernel/head_40x.S
@@ -44,11 +44,7 @@
* execution begins here, the following registers contain valid, yet
* optional, information:
*
- * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
- * r4 - Starting address of the init RAM disk
- * r5 - Ending address of the init RAM disk
- * r6 - Start of kernel command line string (e.g. "mem=96m")
- * r7 - End of kernel command line string
+ * r3 - Device tree pointer (DRAM, frequency, MAC address, etc.)
*
* This is all going to change RSN when we add bi_recs....... -- Dan
*/
@@ -59,10 +55,6 @@ _ENTRY(_start);
/* Save parameters we are passed.
*/
mr r31,r3
- mr r30,r4
- mr r29,r5
- mr r28,r6
- mr r27,r7
/* We have to turn on the MMU right away so we get cache modes
* set correctly.
@@ -848,10 +840,6 @@ start_here:
* Decide what sort of machine this is and initialize the MMU.
*/
mr r3,r31
- mr r4,r30
- mr r5,r29
- mr r6,r28
- mr r7,r27
bl machine_init
bl MMU_init
diff --git a/arch/powerpc/kernel/head_44x.S b/arch/powerpc/kernel/head_44x.S
index f3a1ea9..8098b59 100644
--- a/arch/powerpc/kernel/head_44x.S
+++ b/arch/powerpc/kernel/head_44x.S
@@ -43,11 +43,7 @@
* execution begins here, the following registers contain valid, yet
* optional, information:
*
- * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
- * r4 - Starting address of the init RAM disk
- * r5 - Ending address of the init RAM disk
- * r6 - Start of kernel command line string (e.g. "mem=128")
- * r7 - End of kernel command line string
+ * r3 - Device tree pointer (DRAM, frequency, MAC address, etc.)
*
*/
.section .text.head, "ax"
@@ -62,10 +58,6 @@ _ENTRY(_start);
* Save parameters we are passed
*/
mr r31,r3
- mr r30,r4
- mr r29,r5
- mr r28,r6
- mr r27,r7
li r24,0 /* CPU number */
/*
@@ -241,10 +233,6 @@ skpinv: addi r4,r4,1 /* Increment */
* Decide what sort of machine this is and initialize the MMU.
*/
mr r3,r31
- mr r4,r30
- mr r5,r29
- mr r6,r28
- mr r7,r27
bl machine_init
bl MMU_init
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S
index 3c9452d..a61d563 100644
--- a/arch/powerpc/kernel/head_8xx.S
+++ b/arch/powerpc/kernel/head_8xx.S
@@ -46,11 +46,7 @@ _ENTRY(_start);
* This port was done on an MBX board with an 860. Right now I only
* support an ELF compressed (zImage) boot from EPPC-Bug because the
* code there loads up some registers before calling us:
- * r3: ptr to board info data
- * r4: initrd_start or if no initrd then 0
- * r5: initrd_end - unused if r4 is 0
- * r6: Start of command line string
- * r7: End of command line string
+ * r3 - Device tree pointer (DRAM, frequency, MAC address, etc.)
*
* I decided to use conditional compilation instead of checking PVR and
* adding more processor specific branches around code I don't need.
@@ -78,10 +74,6 @@ _ENTRY(_start);
.globl __start
__start:
mr r31,r3 /* save parameters */
- mr r30,r4
- mr r29,r5
- mr r28,r6
- mr r27,r7
/* We have to turn on the MMU right away so we get cache modes
* set correctly.
@@ -618,10 +610,6 @@ start_here:
* Decide what sort of machine this is and initialize the MMU.
*/
mr r3,r31
- mr r4,r30
- mr r5,r29
- mr r6,r28
- mr r7,r27
bl machine_init
bl MMU_init
diff --git a/arch/powerpc/kernel/head_fsl_booke.S b/arch/powerpc/kernel/head_fsl_booke.S
index 18c0093..e42aa44 100644
--- a/arch/powerpc/kernel/head_fsl_booke.S
+++ b/arch/powerpc/kernel/head_fsl_booke.S
@@ -46,11 +46,7 @@
* execution begins here, the following registers contain valid, yet
* optional, information:
*
- * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.)
- * r4 - Starting address of the init RAM disk
- * r5 - Ending address of the init RAM disk
- * r6 - Start of kernel command line string (e.g. "mem=128")
- * r7 - End of kernel command line string
+ * r3 - Device tree pointer (DRAM, frequency, MAC address, etc.)
*
*/
.section .text.head, "ax"
@@ -65,10 +61,6 @@ _ENTRY(_start);
* Save parameters we are passed
*/
mr r31,r3
- mr r30,r4
- mr r29,r5
- mr r28,r6
- mr r27,r7
li r25,0 /* phys kernel start (low) */
li r24,0 /* CPU number */
li r23,0 /* phys kernel start (high) */
@@ -383,10 +375,6 @@ skpinv: addi r6,r6,1 /* Increment */
* Decide what sort of machine this is and initialize the MMU.
*/
mr r3,r31
- mr r4,r30
- mr r5,r29
- mr r6,r28
- mr r7,r27
bl machine_init
bl MMU_init
--
1.5.6.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] powerpc: reflect the used arguments in machine_init() prototype
2008-10-12 14:08 Remove unused args in head_* Sebastian Andrzej Siewior
2008-10-12 14:08 ` [PATCH 1/2] powerpc: don't pass unused regs around in head_.*.S Sebastian Andrzej Siewior
@ 2008-10-12 14:08 ` Sebastian Andrzej Siewior
1 sibling, 0 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2008-10-12 14:08 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Sebastian Andrzej Siewior
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
phys arg isn't used. Kill it.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
arch/powerpc/kernel/setup_32.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 1e0df16..c1a2762 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -111,7 +111,7 @@ notrace unsigned long __init early_init(unsigned long dt_ptr)
* This is called very early on the boot process, after a minimal
* MMU environment has been set up but before MMU_init is called.
*/
-notrace void __init machine_init(unsigned long dt_ptr, unsigned long phys)
+notrace void __init machine_init(unsigned long dt_ptr)
{
/* Enable early debugging if any specified (see udbg.h) */
udbg_early_init();
--
1.5.6.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] powerpc: don't pass unused regs around in head_.*.S
2008-10-12 14:08 ` [PATCH 1/2] powerpc: don't pass unused regs around in head_.*.S Sebastian Andrzej Siewior
@ 2008-10-13 23:25 ` Benjamin Herrenschmidt
2008-10-14 9:08 ` Sebastian Andrzej Siewior
0 siblings, 1 reply; 5+ messages in thread
From: Benjamin Herrenschmidt @ 2008-10-13 23:25 UTC (permalink / raw)
To: Sebastian Andrzej Siewior; +Cc: linuxppc-dev, Sebastian Andrzej Siewior
On Sun, 2008-10-12 at 16:08 +0200, Sebastian Andrzej Siewior wrote:
> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> This looks like a relict from arch/ppc. machine_init() is accepting
> only two parameters (dtb, phys) and is using only the first one.
This isn't 100% correct actually...
First, the base head_32.S (could be called head_6xx.S I suppose)
supports a few more calling conventions such as the real OF one, with
added support for initrd and cmdline in registers , and the BootX one.
Then, calling convention for the other cases is slightly better defined
than just having r3 contain a device-tree pointer. The physical address
is an important part of it, the fact that r5 is NULL to differenciate
from an OF entry too, and we're moving toward the full ePAPR definition.
Cheers,
Ben.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] powerpc: don't pass unused regs around in head_.*.S
2008-10-13 23:25 ` Benjamin Herrenschmidt
@ 2008-10-14 9:08 ` Sebastian Andrzej Siewior
0 siblings, 0 replies; 5+ messages in thread
From: Sebastian Andrzej Siewior @ 2008-10-14 9:08 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Sebastian Andrzej Siewior
* Benjamin Herrenschmidt | 2008-10-14 10:25:12 [+1100]:
>On Sun, 2008-10-12 at 16:08 +0200, Sebastian Andrzej Siewior wrote:
>> From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>>
>> This looks like a relict from arch/ppc. machine_init() is accepting
>> only two parameters (dtb, phys) and is using only the first one.
>
>This isn't 100% correct actually...
>
>First, the base head_32.S (could be called head_6xx.S I suppose)
>supports a few more calling conventions such as the real OF one, with
>added support for initrd and cmdline in registers , and the BootX one.
Yep, those extra register are only used in prom_init() or bootx_init().
In case we called one of those two we end up again in __start(dtb, phys, 0)
>Then, calling convention for the other cases is slightly better defined
>than just having r3 contain a device-tree pointer. The physical address
>is an important part of it, the fact that r5 is NULL to differenciate
>from an OF entry too, and we're moving toward the full ePAPR definition.
Okay. Power_ePAPR_APPROVED_v1.0.pdf says we have r4, r5, r8, r9 = 0, r6 =
magic and r7 size of the initial mapped area. I don't see the physical
address here.
Do you want me to update the comment / patch description or leave
everything as it? I guess we don't have to pass unused register to
machine_init(), do we?
>Cheers,
>Ben.
Sebastian
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-10-14 9:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-12 14:08 Remove unused args in head_* Sebastian Andrzej Siewior
2008-10-12 14:08 ` [PATCH 1/2] powerpc: don't pass unused regs around in head_.*.S Sebastian Andrzej Siewior
2008-10-13 23:25 ` Benjamin Herrenschmidt
2008-10-14 9:08 ` Sebastian Andrzej Siewior
2008-10-12 14:08 ` [PATCH 2/2] powerpc: reflect the used arguments in machine_init() prototype Sebastian Andrzej Siewior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).