linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* Collie/Simpad hacks in head-sa1100.S break booting on other machines
@ 2009-09-09 12:54 Dmitry Artamonow
  2009-09-10  2:14 ` Eric Miao
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Artamonow @ 2009-09-09 12:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hello!

When trying to boot kernel with both CONFIG_SA1100_COLLIE and
CONFIG_SA1100_H3600 compiled in on iPaq h3600, I suddenly have been
bitten by this hack in arch/arm/boot/compressed/head-sa1100.S:

#ifdef CONFIG_SA1100_COLLIE
                mov     r7, #MACH_TYPE_COLLIE
#endif

Yes, it's silently sets machine ID to MACH_TYPE_COLLIE on _any_ SA1100 machine
if CONFIG_SA1100_COLLIE is set. And there's also similar hack (or broken
bootloader workaround, if you like) for Simpad.

I don't know if these hacks are needed anymore (for Collie with stock
bootloader probably yes, for Simpad I don't know as I don't have this
hardware), but I think something should be done at least to prevent
selecting other machines if CONFIG_SA1100_COLLIE or CONFIG_SA1100_SIMPAD
selected. Please find not very elegant, but working patch in attahment.
It just adds "depends on !SA1100_COLLIE && !SA1100_SIMPAD" to every other
machine. Sadly, I'm not an expert in kconfig - maybe there's a better way
to do that?

-- 
Best regards,
Dmitry "MAD" Artamonow

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Collie/Simpad hacks in head-sa1100.S break booting on other machines
  2009-09-09 12:54 Collie/Simpad hacks in head-sa1100.S break booting on other machines Dmitry Artamonow
@ 2009-09-10  2:14 ` Eric Miao
  2009-09-15 11:34   ` Pavel Machek
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Miao @ 2009-09-10  2:14 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Sep 9, 2009 at 8:54 PM, Dmitry Artamonow <mad_soft@inbox.ru> wrote:
> Hello!
>
> When trying to boot kernel with both CONFIG_SA1100_COLLIE and
> CONFIG_SA1100_H3600 compiled in on iPaq h3600, I suddenly have been
> bitten by this hack in arch/arm/boot/compressed/head-sa1100.S:
>
> #ifdef CONFIG_SA1100_COLLIE
> ? ? ? ? ? ? ? ?mov ? ? r7, #MACH_TYPE_COLLIE
> #endif
>
> Yes, it's silently sets machine ID to MACH_TYPE_COLLIE on _any_ SA1100 machine
> if CONFIG_SA1100_COLLIE is set. And there's also similar hack (or broken
> bootloader workaround, if you like) for Simpad.
>
> I don't know if these hacks are needed anymore (for Collie with stock
> bootloader probably yes, for Simpad I don't know as I don't have this
> hardware), but I think something should be done at least to prevent
> selecting other machines if CONFIG_SA1100_COLLIE or CONFIG_SA1100_SIMPAD
> selected. Please find not very elegant, but working patch in attahment.
> It just adds "depends on !SA1100_COLLIE && !SA1100_SIMPAD" to every other
> machine. Sadly, I'm not an expert in kconfig - maybe there's a better way
> to do that?
>

Sadly, this doesn't look like a correct approach. Remember that machines
can just be compiled into a single vmlinux all together without excluding
each other.

This is true on pxa25x/pxa27x with Sharp Zaurus due to their lack of a
compliant boot loader, so that dirty hack is there to detect which model
is.

A good fix would be to the bootloader to tell the kernel about the correct
machine ID, and if that's difficult, a compromised one would be a short
block of detection code which doesn't conflict with other machines.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Collie/Simpad hacks in head-sa1100.S break booting on other machines
  2009-09-10  2:14 ` Eric Miao
@ 2009-09-15 11:34   ` Pavel Machek
  0 siblings, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2009-09-15 11:34 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu 2009-09-10 10:14:21, Eric Miao wrote:
> On Wed, Sep 9, 2009 at 8:54 PM, Dmitry Artamonow <mad_soft@inbox.ru> wrote:
> > Hello!
> >
> > When trying to boot kernel with both CONFIG_SA1100_COLLIE and
> > CONFIG_SA1100_H3600 compiled in on iPaq h3600, I suddenly have been
> > bitten by this hack in arch/arm/boot/compressed/head-sa1100.S:
> >
> > #ifdef CONFIG_SA1100_COLLIE
> > ?? ?? ?? ?? ?? ?? ?? ??mov ?? ?? r7, #MACH_TYPE_COLLIE
> > #endif
> >
> > Yes, it's silently sets machine ID to MACH_TYPE_COLLIE on _any_ SA1100 machine
> > if CONFIG_SA1100_COLLIE is set. And there's also similar hack (or broken
> > bootloader workaround, if you like) for Simpad.
> >
> > I don't know if these hacks are needed anymore (for Collie with stock
> > bootloader probably yes, for Simpad I don't know as I don't have this
> > hardware), but I think something should be done at least to prevent
> > selecting other machines if CONFIG_SA1100_COLLIE or CONFIG_SA1100_SIMPAD
> > selected. Please find not very elegant, but working patch in attahment.
> > It just adds "depends on !SA1100_COLLIE && !SA1100_SIMPAD" to every other
> > machine. Sadly, I'm not an expert in kconfig - maybe there's a better way
> > to do that?
> >
> 
> Sadly, this doesn't look like a correct approach. Remember that machines
> can just be compiled into a single vmlinux all together without excluding
> each other.

Well, not for collie... And fixing it properly looks hard (he probably
does not have hw; I do, but...) so disallowing known-bad case in
kconfig seems like way to go.

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-09-15 11:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-09 12:54 Collie/Simpad hacks in head-sa1100.S break booting on other machines Dmitry Artamonow
2009-09-10  2:14 ` Eric Miao
2009-09-15 11:34   ` Pavel Machek

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).