* [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point for uImage to ZRELADDR + 6MB)
[not found] ` <20080116205131.GA3605@digi.com>
@ 2008-01-30 8:08 ` Uwe Kleine-König
2008-01-30 9:33 ` [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint " Ulf Samuelsson
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Uwe Kleine-König @ 2008-01-30 8:08 UTC (permalink / raw)
To: u-boot
Hello Nicolas,
Nicolas Pitre wrote:
> > But does U-Boot properly provide machine information to the kernel these
> > days? I have been and still being burned by U-Boot hardcoding the
> > _wrong_ machine ID, and therefore custom built kernels from k.o simply
> > won't boot on those boards without hacking the kernel source.
> With "our" U-Boot you can override the compiled-in machid with an
> environment variable. I didn't implement this patch but I think it's
> not that difficult. I will check tomorrow if I can easily get a patch
> out of our scm.
It took a bit longer, but here it comes. This is on top of todays
u-boot.
I didn't tested this patch in that version, but this is how it is done
in our version of U-Boot (that is considerable older).
Switching the machid is also very convenient because we have modules
that can be plugged on different base boards and so can use different
machids.
Best regards
Uwe
--->8---
From: Uwe Kleine-K?nig <Uwe.Kleine-Koenig@digi.com>
make the machid configurable via the environment
If the variable "machid" exists, let do_bootm_linux use that instead of
bd->bi_arch_number.
Signed-off-by: Uwe Kleine-K?nig <Uwe.Kleine-Koenig@digi.com>
---
lib_arm/armlinux.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/lib_arm/armlinux.c b/lib_arm/armlinux.c
index 6d32a41..62185f0 100644
--- a/lib_arm/armlinux.c
+++ b/lib_arm/armlinux.c
@@ -78,6 +78,8 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
void (*theKernel)(int zero, int arch, uint params);
image_header_t *hdr = &header;
bd_t *bd = gd->bd;
+ int machid = bd->bi_arch_number;
+ char *s;
#ifdef CONFIG_CMDLINE_TAG
char *commandline = getenv ("bootargs");
@@ -85,6 +87,12 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
theKernel = (void (*)(int, int, uint))ntohl(hdr->ih_ep);
+ s = getenv ("machid");
+ if (s) {
+ machid = simple_strtoul (s, NULL, 16);
+ printf ("Using machid 0x%x from environment\n", machid);
+ }
+
/*
* Check if there is an initrd image
*/
@@ -260,7 +268,7 @@ void do_bootm_linux (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
cleanup_before_linux ();
- theKernel (0, bd->bi_arch_number, bd->bi_boot_params);
+ theKernel (0, machid, bd->bi_boot_params);
}
--
1.5.3.8
--
Uwe Kleine-K?nig, Software Engineer
Digi International GmbH Branch Breisach, K?ferstrasse 8, 79206 Breisach, Germany
Tax: 315/5781/0242 / VAT: DE153662976 / Reg. Amtsgericht Dortmund HRB 13962
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint for uImage to ZRELADDR + 6MB)
2008-01-30 8:08 ` [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point for uImage to ZRELADDR + 6MB) Uwe Kleine-König
@ 2008-01-30 9:33 ` Ulf Samuelsson
2008-01-30 14:53 ` Nicolas Pitre
` (2 more replies)
2008-01-30 23:41 ` [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point " Wolfgang Denk
2008-02-14 21:25 ` Wolfgang Denk
2 siblings, 3 replies; 9+ messages in thread
From: Ulf Samuelsson @ 2008-01-30 9:33 UTC (permalink / raw)
To: u-boot
Nicolas Pitre wrote:
> > But does U-Boot properly provide machine information to the kernel these
> > days? I have been and still being burned by U-Boot hardcoding the
> > _wrong_ machine ID, and therefore custom built kernels from k.o simply
> > won't boot on those boards without hacking the kernel source.
> With "our" U-Boot you can override the compiled-in machid with an
> environment variable. I didn't implement this patch but I think it's
> not that difficult. I will check tomorrow if I can easily get a patch
> out of our scm.
I proposed this patch for a long time, but it was rejected by Wolfgang.
I am seeing multiple companies implementing small CPU modules
incorporating CPU + FPGA, and the customers will adopt the FPGA
code for their own need, and then they need to create a new machine id.
Having such a patch will allow people in this situation to use the
U-Boot on the board without recompilation.
Best Regards
Ulf Samuelsson
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint for uImage to ZRELADDR + 6MB)
2008-01-30 9:33 ` [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint " Ulf Samuelsson
@ 2008-01-30 14:53 ` Nicolas Pitre
2008-01-30 15:47 ` Russell King - ARM Linux
2008-01-30 23:49 ` Wolfgang Denk
2 siblings, 0 replies; 9+ messages in thread
From: Nicolas Pitre @ 2008-01-30 14:53 UTC (permalink / raw)
To: u-boot
On Wed, 30 Jan 2008, Ulf Samuelsson wrote:
> Nicolas Pitre wrote:
> > > But does U-Boot properly provide machine information to the kernel these
> > > days? I have been and still being burned by U-Boot hardcoding the
> > > _wrong_ machine ID, and therefore custom built kernels from k.o simply
> > > won't boot on those boards without hacking the kernel source.
> > With "our" U-Boot you can override the compiled-in machid with an
> > environment variable. I didn't implement this patch but I think it's
> > not that difficult. I will check tomorrow if I can easily get a patch
> > out of our scm.
>
> I proposed this patch for a long time, but it was rejected by Wolfgang.
And may Wolfgang explain just why?
> I am seeing multiple companies implementing small CPU modules
> incorporating CPU + FPGA, and the customers will adopt the FPGA
> code for their own need, and then they need to create a new machine id.
>
> Having such a patch will allow people in this situation to use the
> U-Boot on the board without recompilation.
Yes, and it will considerably reduce the grundge against U-Boot from
kernel people, myself included.
The current situation with U-Boot simply encourage people to put stupid
hacks in the kernel instead in order to work around this U-Boot
artificial limitation, which is not bringing any sympathy for better
U-Boot support in the kernel build system amongst other things.
So I'm asking for Wolfgang to seriously reconsider accepting this patch.
Nicolas
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint for uImage to ZRELADDR + 6MB)
2008-01-30 9:33 ` [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint " Ulf Samuelsson
2008-01-30 14:53 ` Nicolas Pitre
@ 2008-01-30 15:47 ` Russell King - ARM Linux
2008-01-31 0:05 ` Wolfgang Denk
2008-01-30 23:49 ` Wolfgang Denk
2 siblings, 1 reply; 9+ messages in thread
From: Russell King - ARM Linux @ 2008-01-30 15:47 UTC (permalink / raw)
To: u-boot
On Wed, Jan 30, 2008 at 10:33:46AM +0100, Ulf Samuelsson wrote:
> Nicolas Pitre wrote:
> > > But does U-Boot properly provide machine information to the kernel these
> > > days? I have been and still being burned by U-Boot hardcoding the
> > > _wrong_ machine ID, and therefore custom built kernels from k.o simply
> > > won't boot on those boards without hacking the kernel source.
> > With "our" U-Boot you can override the compiled-in machid with an
> > environment variable. I didn't implement this patch but I think it's
> > not that difficult. I will check tomorrow if I can easily get a patch
> > out of our scm.
>
> I proposed this patch for a long time, but it was rejected by Wolfgang.
One solution to that problem is to have someone who maintains a separate
tree for uboot which does have the feature in. Then it becomes a matter
of community choice whether they use the official tree or the tree with
sensible machine-id configurability.
That way, those who want the configurability can have it, and Wolfgang can
avoid having his tree polluted with useful features he doesn't want.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point for uImage to ZRELADDR + 6MB)
2008-01-30 8:08 ` [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point for uImage to ZRELADDR + 6MB) Uwe Kleine-König
2008-01-30 9:33 ` [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint " Ulf Samuelsson
@ 2008-01-30 23:41 ` Wolfgang Denk
2008-02-14 21:25 ` Wolfgang Denk
2 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2008-01-30 23:41 UTC (permalink / raw)
To: u-boot
In message <20080130080849.GA25875@digi.com> you wrote:
>
> From: Uwe Kleine-K=F6nig <Uwe.Kleine-Koenig@digi.com>
>
> make the machid configurable via the environment
>
> If the variable "machid" exists, let do_bootm_linux use that instead of
> bd->bi_arch_number.
>
> Signed-off-by: Uwe Kleine-K=F6nig <Uwe.Kleine-Koenig@digi.com>
Acked-by: Wolfgang Denk <wd@denx.de>
Best regards,
Wolfgang Denk
--
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
"There are three principal ways to lose money: wine, women, and en-
gineers. While the first two are more pleasant, the third is by far
the more certain." -- Baron Rothschild, ca. 1800
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint for uImage to ZRELADDR + 6MB)
2008-01-30 9:33 ` [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint " Ulf Samuelsson
2008-01-30 14:53 ` Nicolas Pitre
2008-01-30 15:47 ` Russell King - ARM Linux
@ 2008-01-30 23:49 ` Wolfgang Denk
2 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2008-01-30 23:49 UTC (permalink / raw)
To: u-boot
In message <000201c8634b$546ee570$8901a8c0@atmel.com> you wrote:
>
> I proposed this patch for a long time, but it was rejected by Wolfgang.
Either you did it differently, or I changed my mind.
Best regards,
Wolfgang Denk
--
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
Due to lack of disk space, this fortune database has been discontinued.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint for uImage to ZRELADDR + 6MB)
2008-01-30 15:47 ` Russell King - ARM Linux
@ 2008-01-31 0:05 ` Wolfgang Denk
2008-01-31 8:43 ` Russell King - ARM Linux
0 siblings, 1 reply; 9+ messages in thread
From: Wolfgang Denk @ 2008-01-31 0:05 UTC (permalink / raw)
To: u-boot
In message <20080130154740.GA29330@flint.arm.linux.org.uk> you wrote:
>
> > I proposed this patch for a long time, but it was rejected by Wolfgang.
>
> One solution to that problem is to have someone who maintains a separate
> tree for uboot which does have the feature in. Then it becomes a matter
> of community choice whether they use the official tree or the tree with
> sensible machine-id configurability.
>
> That way, those who want the configurability can have it, and Wolfgang can
> avoid having his tree polluted with useful features he doesn't want.
Russel, are you by chance volunteering to become the custodian for
the ARM related parts of U-Boot? Just let me know...
BTW: do you actually know what you are commenting about? Did you look
up Ulf's proposal and the reject message in the U-Boot mailing list
archive?
Best regards,
Wolfgang Denk
--
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
What is wanted is not the will to believe, but the will to find out,
which is the exact opposite.
-- Bertrand Russell, "Skeptical Essays", 1928
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint for uImage to ZRELADDR + 6MB)
2008-01-31 0:05 ` Wolfgang Denk
@ 2008-01-31 8:43 ` Russell King - ARM Linux
0 siblings, 0 replies; 9+ messages in thread
From: Russell King - ARM Linux @ 2008-01-31 8:43 UTC (permalink / raw)
To: u-boot
On Thu, Jan 31, 2008 at 01:05:44AM +0100, Wolfgang Denk wrote:
> In message <20080130154740.GA29330@flint.arm.linux.org.uk> you wrote:
> >
> > > I proposed this patch for a long time, but it was rejected by Wolfgang.
> >
> > One solution to that problem is to have someone who maintains a separate
> > tree for uboot which does have the feature in. Then it becomes a matter
> > of community choice whether they use the official tree or the tree with
> > sensible machine-id configurability.
> >
> > That way, those who want the configurability can have it, and Wolfgang can
> > avoid having his tree polluted with useful features he doesn't want.
>
> Russel, are you by chance volunteering to become the custodian for
> the ARM related parts of U-Boot? Just let me know...
Wulfgage, no I am not.
> BTW: do you actually know what you are commenting about? Did you look
> up Ulf's proposal and the reject message in the U-Boot mailing list
> archive?
Duh. I think everyone knows the answer to those questions who've seen
my past comments on this subject - and it's plainly obvious what the
answer to the second question is.
^ permalink raw reply [flat|nested] 9+ messages in thread
* [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point for uImage to ZRELADDR + 6MB)
2008-01-30 8:08 ` [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point for uImage to ZRELADDR + 6MB) Uwe Kleine-König
2008-01-30 9:33 ` [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint " Ulf Samuelsson
2008-01-30 23:41 ` [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point " Wolfgang Denk
@ 2008-02-14 21:25 ` Wolfgang Denk
2 siblings, 0 replies; 9+ messages in thread
From: Wolfgang Denk @ 2008-02-14 21:25 UTC (permalink / raw)
To: u-boot
In message <20080130080849.GA25875@digi.com> you wrote:
>
> make the machid configurable via the environment
>
> If the variable "machid" exists, let do_bootm_linux use that instead of
> bd->bi_arch_number.
>
> Signed-off-by: Uwe Kleine-K=F6nig <Uwe.Kleine-Koenig@digi.com>
> ---
> lib_arm/armlinux.c | 10 +++++++++-
> 1 files changed, 9 insertions(+), 1 deletions(-)
Applied, thanks.
Best regards,
Wolfgang Denk
--
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
If I don't document something, it's usually either for a good reason,
or a bad reason. In this case it's a good reason. :-)
- Larry Wall in <1992Jan17.005405.16806@netlabs.com>
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2008-02-14 21:25 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1200469629509-git-send-email-vivek.kutal@celunite.com>
[not found] ` <20080116081303.GA25437@uranus.ravnborg.org>
[not found] ` <20080116100904.GA4487@digi.com>
[not found] ` <alpine.LFD.1.00.0801160855140.25841@xanadu.home>
[not found] ` <20080116163434.GA2955@digi.com>
[not found] ` <alpine.LFD.1.00.0801161233050.25841@xanadu.home>
[not found] ` <20080116181027.GB29568@uranus.ravnborg.org>
[not found] ` <alpine.LFD.1.00.0801161318000.25841@xanadu.home>
[not found] ` <20080116205131.GA3605@digi.com>
2008-01-30 8:08 ` [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point for uImage to ZRELADDR + 6MB) Uwe Kleine-König
2008-01-30 9:33 ` [U-Boot-Users] [PATCH] make the machid configurable via theenvironment (Was: [PATCH] Changed load address and entrypoint " Ulf Samuelsson
2008-01-30 14:53 ` Nicolas Pitre
2008-01-30 15:47 ` Russell King - ARM Linux
2008-01-31 0:05 ` Wolfgang Denk
2008-01-31 8:43 ` Russell King - ARM Linux
2008-01-30 23:49 ` Wolfgang Denk
2008-01-30 23:41 ` [U-Boot-Users] [PATCH] make the machid configurable via the environment (Was: [PATCH] Changed load address and entry point " Wolfgang Denk
2008-02-14 21:25 ` Wolfgang Denk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox