Re: [PATCH] powerpc: dtb and purgatory support for ppc32
On Sun, Oct 12, 2008 at 03:39:55PM +0200, Sebastian Andrzej Siewior wrote: * Simon Horman | 2008-10-08 14:03:26 [+1100]: +#ifdef WITH_GAMECUBE +static int go_purgatory = 0; +#else +static int go_purgatory = 1; +#endif Can you just use WITH_GAMECUBE inside elf_ppc_load() and remove the need for go_purgatory, or do you plan to make go_purgatory switchable at run-time at some point in the future? For the first shot I would prefer to use WITH_GAMECUBE inside of elf_ppc_load(). In longterm I don't see any reason why GameCube can't use the purgatory code like the other archs and get the memory maps from the device tree. However I'm not sure if GameCube still runs on a recent kernel: now that arc/ppc isn't available anymore GameCube has to pass a dtb somehow and this isn't the case. So therefore I would like the keep #ifdef and the exisiting behavior until someone clears this up. Ok, in this case I would like to request that you remove go_purgatory (for now) and just use #ifdef WITH_GAMECUBE instead. I think that it will make things cleaner (for now). -- Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc: dtb and purgatory support for ppc32
* Simon Horman | 2008-10-08 14:03:26 [+1100]: +#ifdef WITH_GAMECUBE +static int go_purgatory = 0; +#else +static int go_purgatory = 1; +#endif Can you just use WITH_GAMECUBE inside elf_ppc_load() and remove the need for go_purgatory, or do you plan to make go_purgatory switchable at run-time at some point in the future? For the first shot I would prefer to use WITH_GAMECUBE inside of elf_ppc_load(). In longterm I don't see any reason why GameCube can't use the purgatory code like the other archs and get the memory maps from the device tree. However I'm not sure if GameCube still runs on a recent kernel: now that arc/ppc isn't available anymore GameCube has to pass a dtb somehow and this isn't the case. So therefore I would like the keep #ifdef and the exisiting behavior until someone clears this up. Simon Horman Sebastian ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc: dtb and purgatory support for ppc32
On Wed, Oct 01, 2008 at 11:20:24PM +0200, Sebastian Andrzej Siewior wrote: From: Sebastian Siewior [EMAIL PROTECTED] Some code dtb scanning filling has been borrowed from ppc64. The old behavior is still available if compiled with GameCube, other PowerPC platform use the can purgatory and specify a new dtb. The purgatory is disabled because somehting is wrong and I dunno the reason. Booting a self containd cuImage (incl. dtb / wiuthout the need for a bd sturct) can be booted. Signed-off-by: Sebastian Andrzej Siewior [EMAIL PROTECTED] --- kexec/arch/ppc/Makefile|1 + kexec/arch/ppc/kexec-elf-ppc.c | 167 ++ kexec/arch/ppc/kexec-elf-rel-ppc.c |4 + kexec/arch/ppc/kexec-ppc.c | 469 +++- purgatory/arch/ppc/Makefile|1 + purgatory/arch/ppc/purgatory-ppc.c |4 + purgatory/arch/ppc/v2wrap.S| 54 7 files changed, 652 insertions(+), 48 deletions(-) create mode 100644 purgatory/arch/ppc/v2wrap.S diff --git a/kexec/arch/ppc/Makefile b/kexec/arch/ppc/Makefile index 1550c20..ac05bf8 100644 --- a/kexec/arch/ppc/Makefile +++ b/kexec/arch/ppc/Makefile @@ -7,6 +7,7 @@ ppc_KEXEC_SRCS += kexec/arch/ppc/kexec-elf-rel-ppc.c ppc_KEXEC_SRCS += kexec/arch/ppc/kexec-dol-ppc.c ppc_KEXEC_SRCS += kexec/arch/ppc/ppc-setup-simple.S ppc_KEXEC_SRCS += kexec/arch/ppc/ppc-setup-dol.S +ppc_KEXEC_SRCS += kexec/arch/ppc64/fs2dt.c dist += kexec/arch/ppc/Makefile $(ppc_KEXEC_SRCS)\ kexec/arch/ppc/kexec-ppc.h kexec/arch/ppc/ppc_asm.h \ diff --git a/kexec/arch/ppc/kexec-elf-ppc.c b/kexec/arch/ppc/kexec-elf-ppc.c index 530e501..d4cfb93 100644 --- a/kexec/arch/ppc/kexec-elf-ppc.c +++ b/kexec/arch/ppc/kexec-elf-ppc.c @@ -26,6 +26,15 @@ #include config.h +/* these are here to keep arch/ppc64/fs2dt.c happy and are not implemented */ +#include ../ppc64/kexec-ppc64.h +mem_rgns_t usablemem_rgns = {0, NULL}; +unsigned char reuse_initrd = 0; +uint64_t initrd_base, initrd_size; +/* */ + +int create_flatten_tree(struct kexec_info *, unsigned char **, unsigned long *, + char *); static const int probe_debug = 0; #define MAX_COMMAND_LINE 256 @@ -91,16 +100,6 @@ int elf_ppc_probe(const char *buf, off_t len) return result; } -void elf_ppc_usage(void) -{ - printf - ( - --command-line=STRING Set the kernel command line to STRING.\n - --append=STRING Set the kernel command line to STRING.\n - --gamecube=1|0Enable/disable support for ELFs with changed\n -addresses suitable for the GameCube.\n); -} - static void gamecube_hack_addresses(struct mem_ehdr *ehdr) { struct mem_phdr *phdr, *phdr_end; @@ -122,6 +121,36 @@ static void gamecube_hack_addresses(struct mem_ehdr *ehdr) } } +#define OPT_APPEND (OPT_ARCH_MAX+0) +#define OPT_GAMECUBE (OPT_ARCH_MAX+1) +#define OPT_DTB (OPT_ARCH_MAX+2) +static const struct option options[] = { + KEXEC_ARCH_OPTIONS + {command-line, 1, 0, OPT_APPEND}, + {append, 1, 0, OPT_APPEND}, + {gamecube, 1, 0, OPT_GAMECUBE}, + {dtb, 1, 0, OPT_DTB}, + {0, 0, 0, 0}, +}; +static const char short_options[] = KEXEC_ARCH_OPT_STR d; + +void elf_ppc_usage(void) +{ + printf( + --command-line=STRING Set the kernel command line to STRING.\n + --append=STRING Set the kernel command line to STRING.\n + --gamecube=1|0Enable/disable support for ELFs with changed\n +addresses suitable for the GameCube.\n + --devicetreeblob=filename Specify device tree blob file.\n + ); +} + +#ifdef WITH_GAMECUBE +static int go_purgatory = 0; +#else +static int go_purgatory = 1; +#endif Can you just use WITH_GAMECUBE inside elf_ppc_load() and remove the need for go_purgatory, or do you plan to make go_purgatory switchable at run-time at some point in the future? + int elf_ppc_load(int argc, char **argv, const char *buf, off_t len, struct kexec_info *info) { @@ -131,10 +160,11 @@ int elf_ppc_load(int argc, char **argv, const char *buf, off_t len, unsigned long arg_base; struct boot_notes *notes; size_t note_bytes; - const char *command_line; + char *command_line; int command_line_len; unsigned char *setup_start; uint32_t setup_size; + char *dtb; int result; #ifdef WITH_GAMECUBE int target_is_gamecube = 1; @@ -142,19 +172,9 @@ int elf_ppc_load(int argc, char **argv, const char *buf, off_t len, int target_is_gamecube = 0; #endif int opt; -#define OPT_APPEND (OPT_ARCH_MAX+0) -#define OPT_GAMECUBE (OPT_ARCH_MAX+1) - static const struct option options[] = { -
Re: [PATCH] powerpc: dtb and purgatory support for ppc32
Kumar Gala wrote: are you trying to get this accepted? If the reviewer don't have any objections yes. You sound like there is something terrible wrong. Do you want it in smaller pieces? - k Sebastian -- Firmensitz: 88690 Uhldingen, Auf dem Berg 3 Registergericht: Amtsgericht Freiburg i. Br., HRB 700 806; StNr. 87007/0; Ust-Id Nr.: DE252739476 Geschäftsführer: Heinz Egger, Thomas Gleixner ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc: dtb and purgatory support for ppc32
On Thu, Oct 02, 2008 at 09:50:16AM +0200, Sebastian Siewior wrote: Kumar Gala wrote: are you trying to get this accepted? If the reviewer don't have any objections yes. You sound like there is something terrible wrong. Do you want it in smaller pieces? I'm not speaking on behalf of Kumar Gala, just on behalf of myself. I would like to get some review of this patch by if possible. Also, I'm a little unclear of how it will interact with the patches that Mohan Kumar sent this week. But at this point I don't see any particular need to break the patch up into smaller pieices. -- Simon Horman VA Linux Systems Japan K.K., Sydney, Australia Satellite Office H: www.vergenet.net/~horms/ W: www.valinux.co.jp/en ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc: dtb and purgatory support for ppc32
On Oct 1, 2008, at 4:20 PM, Sebastian Andrzej Siewior wrote: From: Sebastian Siewior [EMAIL PROTECTED] Some code dtb scanning filling has been borrowed from ppc64. The old behavior is still available if compiled with GameCube, other PowerPC platform use the can purgatory and specify a new dtb. The purgatory is disabled because somehting is wrong and I dunno the reason. Booting a self containd cuImage (incl. dtb / wiuthout the need for a bd sturct) can be booted. Signed-off-by: Sebastian Andrzej Siewior [EMAIL PROTECTED] --- kexec/arch/ppc/Makefile|1 + kexec/arch/ppc/kexec-elf-ppc.c | 167 ++ kexec/arch/ppc/kexec-elf-rel-ppc.c |4 + kexec/arch/ppc/kexec-ppc.c | 469 +++ - purgatory/arch/ppc/Makefile|1 + purgatory/arch/ppc/purgatory-ppc.c |4 + purgatory/arch/ppc/v2wrap.S| 54 7 files changed, 652 insertions(+), 48 deletions(-) create mode 100644 purgatory/arch/ppc/v2wrap.S I think I might have realized some of my confusion.. is this patch to the kernel or to some kexec tool? If its to the kernel I don't answer at all. If its to some kexec tool than that wasn't clear at all. - k ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc: dtb and purgatory support for ppc32
Kumar Gala wrote: On Oct 1, 2008, at 4:20 PM, Sebastian Andrzej Siewior wrote: From: Sebastian Siewior [EMAIL PROTECTED] Some code dtb scanning filling has been borrowed from ppc64. The old behavior is still available if compiled with GameCube, other PowerPC platform use the can purgatory and specify a new dtb. The purgatory is disabled because somehting is wrong and I dunno the reason. Booting a self containd cuImage (incl. dtb / wiuthout the need for a bd sturct) can be booted. Signed-off-by: Sebastian Andrzej Siewior [EMAIL PROTECTED] --- kexec/arch/ppc/Makefile|1 + kexec/arch/ppc/kexec-elf-ppc.c | 167 ++ kexec/arch/ppc/kexec-elf-rel-ppc.c |4 + kexec/arch/ppc/kexec-ppc.c | 469 +++- purgatory/arch/ppc/Makefile|1 + purgatory/arch/ppc/purgatory-ppc.c |4 + purgatory/arch/ppc/v2wrap.S| 54 7 files changed, 652 insertions(+), 48 deletions(-) create mode 100644 purgatory/arch/ppc/v2wrap.S I think I might have realized some of my confusion.. is this patch to the kernel or to some kexec tool? If its to the kernel I don't answer at all. If its to some kexec tool than that wasn't clear at all. Patch 1 and 2 were for kernel side support. Patch 3 is kexec userland only. I wrote this down in the patch first email (should be 0/3) but now I see that git did not enumerate them. Sorry for that, I see that I have to work on git skills The two patches tagged with [RFC] is kernel side support. The third patch tagged with [PATCH] is also meant to be [RFC] and is the kexec userland part against [1]. [1] git://git.kernel.org/pub/scm/linux/kernel/git/horms/kexec-tools.git - k Sebastian ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc: dtb and purgatory support for ppc32
Simon Horman wrote: On Thu, Oct 02, 2008 at 09:50:16AM +0200, Sebastian Siewior wrote: I'm not speaking on behalf of Kumar Gala, just on behalf of myself. Hi Horms, I would like to get some review of this patch by if possible. Also, I'm a little unclear of how it will interact with the patches that Mohan Kumar sent this week. But at this point I don't see any particular need to break the patch up into smaller pieices. My patches are meant for PPC64 only. The patch implements support for relocatable kdump kernel on PPC64 platform. So I don't think Sebastian's patches need to support this relocation support in the kexec-tools as of now. Regards, Mohan. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] powerpc: dtb and purgatory support for ppc32
From: Sebastian Siewior [EMAIL PROTECTED] Some code dtb scanning filling has been borrowed from ppc64. The old behavior is still available if compiled with GameCube, other PowerPC platform use the can purgatory and specify a new dtb. The purgatory is disabled because somehting is wrong and I dunno the reason. Booting a self containd cuImage (incl. dtb / wiuthout the need for a bd sturct) can be booted. Signed-off-by: Sebastian Andrzej Siewior [EMAIL PROTECTED] --- kexec/arch/ppc/Makefile|1 + kexec/arch/ppc/kexec-elf-ppc.c | 167 ++ kexec/arch/ppc/kexec-elf-rel-ppc.c |4 + kexec/arch/ppc/kexec-ppc.c | 469 +++- purgatory/arch/ppc/Makefile|1 + purgatory/arch/ppc/purgatory-ppc.c |4 + purgatory/arch/ppc/v2wrap.S| 54 7 files changed, 652 insertions(+), 48 deletions(-) create mode 100644 purgatory/arch/ppc/v2wrap.S diff --git a/kexec/arch/ppc/Makefile b/kexec/arch/ppc/Makefile index 1550c20..ac05bf8 100644 --- a/kexec/arch/ppc/Makefile +++ b/kexec/arch/ppc/Makefile @@ -7,6 +7,7 @@ ppc_KEXEC_SRCS += kexec/arch/ppc/kexec-elf-rel-ppc.c ppc_KEXEC_SRCS += kexec/arch/ppc/kexec-dol-ppc.c ppc_KEXEC_SRCS += kexec/arch/ppc/ppc-setup-simple.S ppc_KEXEC_SRCS += kexec/arch/ppc/ppc-setup-dol.S +ppc_KEXEC_SRCS += kexec/arch/ppc64/fs2dt.c dist += kexec/arch/ppc/Makefile $(ppc_KEXEC_SRCS) \ kexec/arch/ppc/kexec-ppc.h kexec/arch/ppc/ppc_asm.h \ diff --git a/kexec/arch/ppc/kexec-elf-ppc.c b/kexec/arch/ppc/kexec-elf-ppc.c index 530e501..d4cfb93 100644 --- a/kexec/arch/ppc/kexec-elf-ppc.c +++ b/kexec/arch/ppc/kexec-elf-ppc.c @@ -26,6 +26,15 @@ #include config.h +/* these are here to keep arch/ppc64/fs2dt.c happy and are not implemented */ +#include ../ppc64/kexec-ppc64.h +mem_rgns_t usablemem_rgns = {0, NULL}; +unsigned char reuse_initrd = 0; +uint64_t initrd_base, initrd_size; +/* */ + +int create_flatten_tree(struct kexec_info *, unsigned char **, unsigned long *, + char *); static const int probe_debug = 0; #define MAX_COMMAND_LINE 256 @@ -91,16 +100,6 @@ int elf_ppc_probe(const char *buf, off_t len) return result; } -void elf_ppc_usage(void) -{ - printf - ( ---command-line=STRING Set the kernel command line to STRING.\n ---append=STRING Set the kernel command line to STRING.\n ---gamecube=1|0Enable/disable support for ELFs with changed\n - addresses suitable for the GameCube.\n); -} - static void gamecube_hack_addresses(struct mem_ehdr *ehdr) { struct mem_phdr *phdr, *phdr_end; @@ -122,6 +121,36 @@ static void gamecube_hack_addresses(struct mem_ehdr *ehdr) } } +#define OPT_APPEND (OPT_ARCH_MAX+0) +#define OPT_GAMECUBE (OPT_ARCH_MAX+1) +#define OPT_DTB(OPT_ARCH_MAX+2) +static const struct option options[] = { + KEXEC_ARCH_OPTIONS + {command-line, 1, 0, OPT_APPEND}, + {append, 1, 0, OPT_APPEND}, + {gamecube, 1, 0, OPT_GAMECUBE}, + {dtb, 1, 0, OPT_DTB}, + {0, 0, 0, 0}, +}; +static const char short_options[] = KEXEC_ARCH_OPT_STR d; + +void elf_ppc_usage(void) +{ + printf( +--command-line=STRING Set the kernel command line to STRING.\n +--append=STRING Set the kernel command line to STRING.\n +--gamecube=1|0Enable/disable support for ELFs with changed\n + addresses suitable for the GameCube.\n + --devicetreeblob=filename Specify device tree blob file.\n +); +} + +#ifdef WITH_GAMECUBE +static int go_purgatory = 0; +#else +static int go_purgatory = 1; +#endif + int elf_ppc_load(int argc, char **argv,const char *buf, off_t len, struct kexec_info *info) { @@ -131,10 +160,11 @@ int elf_ppc_load(int argc, char **argv, const char *buf, off_t len, unsigned long arg_base; struct boot_notes *notes; size_t note_bytes; - const char *command_line; + char *command_line; int command_line_len; unsigned char *setup_start; uint32_t setup_size; + char *dtb; int result; #ifdef WITH_GAMECUBE int target_is_gamecube = 1; @@ -142,19 +172,9 @@ int elf_ppc_load(int argc, char **argv,const char *buf, off_t len, int target_is_gamecube = 0; #endif int opt; -#define OPT_APPEND (OPT_ARCH_MAX+0) -#define OPT_GAMECUBE (OPT_ARCH_MAX+1) - static const struct option options[] = { - KEXEC_ARCH_OPTIONS - {command-line, 1, 0, OPT_APPEND}, - {append, 1, 0, OPT_APPEND}, - {gamecube, 1, 0, OPT_GAMECUBE}, - {0, 0, 0, 0}, - }; - static const char short_options[] = KEXEC_ARCH_OPT_STR d; - - command_line
Re: [PATCH] powerpc: dtb and purgatory support for ppc32
On Oct 1, 2008, at 4:20 PM, Sebastian Andrzej Siewior wrote: From: Sebastian Siewior [EMAIL PROTECTED] Some code dtb scanning filling has been borrowed from ppc64. The old behavior is still available if compiled with GameCube, other PowerPC platform use the can purgatory and specify a new dtb. The purgatory is disabled because somehting is wrong and I dunno the reason. Booting a self containd cuImage (incl. dtb / wiuthout the need for a bd sturct) can be booted. Signed-off-by: Sebastian Andrzej Siewior [EMAIL PROTECTED] --- kexec/arch/ppc/Makefile|1 + kexec/arch/ppc/kexec-elf-ppc.c | 167 ++ kexec/arch/ppc/kexec-elf-rel-ppc.c |4 + kexec/arch/ppc/kexec-ppc.c | 469 +++ - purgatory/arch/ppc/Makefile|1 + purgatory/arch/ppc/purgatory-ppc.c |4 + purgatory/arch/ppc/v2wrap.S| 54 7 files changed, 652 insertions(+), 48 deletions(-) create mode 100644 purgatory/arch/ppc/v2wrap.S are you trying to get this accepted? - k ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev