Skip to contentSkip to conversation

sparc: piggyback update

PATCH In review Sam Ravnborg 3 participants 6 messages Dec 31, 2010 – Jan 1, 2011

lore
Share & tools
lore
#0 lore raw

cover sparc: piggyback update

In an attempt to understand how tftp booting works I looked at unifying piggyback_32 and piggyback_64.

Due to subtle differences I did not succeed in the unification - at least not this time around.

But I anyway created a few patches that removes a few differences between sparc and sparc64. And piggyback_32 gained a lot in readability as I have documented my findings using a few comments.

In the process I also removed ELF support from piggyback_32, as it was not used.

The set of patches has been boot tested on sparc.
And build tested on sparc64.

Note: I have not updated piggyback_64.c because the plan was/is that piggyback_32 shall support both sparc and sparc64.

Sam

Sam Ravnborg (5):
sparc: refactor piggy_32.c
sparc: use trapbase in setup_arch
sparc: use _start for the start entry (like 64 bit does)
sparc: additional comments to piggyback_32.c
sparc: remove obsolete ELF support in piggyback_32.c

 arch/sparc/boot/piggyback_32.c |  174 +++++++++++++++++++++++++++-------------
 arch/sparc/kernel/head_32.S    |    3 +-
 arch/sparc/kernel/setup_32.c   |    3 +-
 arch/sparc/mm/sun4c.c          |    8 +-
 4 files changed, 124 insertions(+), 64 deletions(-)
#1 lore raw
Quoted 5 lines · Sam Ravnborg

In an attempt to understand how tftp booting works I looked at unifying piggyback_32 and piggyback_64.

Due to subtle differences I did not succeed in the unification - at least not this time around.

This was the problem I had when I tackled this ages ago.

Sadly none of my patches made it out after the fixes we did late June 2009 as I lost the free time I was working on it in.

Quoted 4 lines

But I anyway created a few patches that removes a few differences between sparc and sparc64. And piggyback_32 gained a lot in readability as I have documented my findings using a few comments.

I've got some patches lying around to bring piggyback_64 up to scratch, I'll post those as soon as I've rebased them.

Quoted 2 lines

In the process I also removed ELF support from piggyback_32, as it was not used.

I'll do this for _64 too.

Quoted 2 lines

Note: I have not updated piggyback_64.c because the plan was/is that piggyback_32 shall support both sparc and sparc64.

My idea was to create a unified piggyback that took $BITS as an argument - then did sensible things based upon that. It never got off the ground here.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#2 lore raw
In reply to Sam Ravnborg
Quoted 4 lines

My idea was to create a unified piggyback that took $BITS as an argument - then did sensible things based upon that. It never got off the ground here.

Rather then doing code-chrunch in piggyback_64 we should add this extra argumant and then let piggyback_32 handle both the 32 and 64 bit case.

The few things that differs is:
1) Check lookup of _start, _end
2) Start address of added image is on different addrees alignemnts (4096 / 8192)
3) sparc64 uses host endian when it stores data in the image (looks lige a bug)
4) sparc64 updates a_text, a_data and a_bss in the a.out header - sparc32 does not. And I could not figure out the expression used to calculate a_text value..

All in all simple differences.
But as my sparc64 box is not yet alive I postponed it until I could actually test it.

Sam

#3 lore raw
In reply to Sam Ravnborg
Quoted 5 lines · Sam Ravnborg
Quoted 4 lines

My idea was to create a unified piggyback that took $BITS as an argument - then did sensible things based upon that. It never got off the ground here.

Quoted 7 lines

Rather then doing code-chrunch in piggyback_64 we should add this extra argumant and then let piggyback_32 handle both the 32 and 64 bit case.

The few things that differs is:
1) Check lookup of _start, _end
2) Start address of added image is on different addrees alignemnts (4096 / 8192)

I've got a patch to factor this out.

Quoted 1 line

3) sparc64 uses host endian when it stores data in the image (looks lige a bug)

It is, I have a patch to fix this. - I'll post it soon.

Quoted 2 lines

4) sparc64 updates a_text, a_data and a_bss in the a.out header - sparc32 does not. And I could not figure out the expression used to calculate a_text value..

hehehe I never got that far - I essentially abandoned my attempt when I saw that _64 was doing stuff that _32 wasn't.

Quoted 3 lines

All in all simple differences.
But as my sparc64 box is not yet alive I postponed it until I could actually test it.

I have a live sparc64 box, however it's currently in a pile of dead sparc32 and 64 boxen, and hasn't been booted for a long time. So it's not exactly accessible - that and I've lost my last real serial port so I can't actually talk to it anymore. (and the expresscard one I obtained for my laptop doesn't work properly for some reason - fricking cheap serial chipsets)

I'll have a go at making it work soon, and see if I can get this going.

In the mean time, I'll send that patch and anything else I've got that looks promising.

Thanks,

Signature · 5 lines
Julian Calaby

Email: [email protected]
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
#4 lore raw
In reply to Sam Ravnborg

From: Sam Ravnborg <[email protected]>
Date: Fri, 31 Dec 2010 10:36:29 +0100

Quoted 2 lines

In an attempt to understand how tftp booting works I looked at unifying piggyback_32 and piggyback_64.

Thanks for this work, but could you please fix your patch submissions so that the actual patches are numbered correctly in the subject lines?

#5 lore raw
In reply to Sam Ravnborg
Quoted 9 lines · David Miller

From: Sam Ravnborg <[email protected]>
Date: Fri, 31 Dec 2010 10:36:29 +0100

Quoted 2 lines

In an attempt to understand how tftp booting works I looked at unifying piggyback_32 and piggyback_64.

Thanks for this work, but could you please fix your patch submissions so that the actual patches are numbered correctly in the subject lines?

Fixed default for "git format-patch" so this should be OK. Will resubmit in a few days with eventual feedback incorporated.

Sam