Board names for 4xx
The patch below allows publishing the type of board the kernel is running on in /proc/cpuinfo (under "machine") for 4xx machines. It displays Walnut boards as "IBM Walnut" and (currently) all others simply as "4xx". Adding other boards is trivial - just a #define in the relevant header file. It also eliminates a warning in ppc4xx_setup.c
arch/ppc/kernel/ppc4xx_setup.c renamed from linuxppc_2_4_devel/arch/ppc/kernel/ppc4xx_setup.c +3 -1
@@ -86,7 +86,7 @@#endif #define BOOT_WDT_DEFAULT_PERIOD 120/* 2 minutes */ -extern board_setup_arch (void); +extern void board_setup_arch (void );void __init ppc4xx_setup_arch (void )
@@ -165,6 +165,8 @@int len =0 ;bd_t *bip = (bd_t *)__res; + len +=sprintf (len + buffer, +"machine\t: %s\n" , PPC4xx_MACHINE_NAME);#ifdef CONFIG_STB03xxx len += sprintf(len + buffer, "plb bus clock\t: %dMHz\n",
include/asm-ppc/walnut.h renamed from linuxppc_2_4_devel/include/asm-ppc/walnut.h +1 -0
@@ -78,6 +78,7 @@/* Generic 4xx type */ #define _MACH_4xx (_MACH_walnut) +#define PPC4xx_MACHINE_NAME "IBM Walnut"#endif /* __WALNUT_H__ */ #endif /* __KERNEL__ */
--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 7 lines · David Gibson
The patch below allows publishing the type of board the kernel is running on in
/proc/cpuinfo(under "machine") for 4xx machines. It displays Walnut boards as "IBM Walnut" and (currently) all others simply as "4xx". Adding other boards is trivial - just a #define in the relevant header file. It also eliminates a warning inppc4xx_setup.c
Oops. The patch below does the same thing, only not broken (forgot a file the first time around).
arch/ppc/kernel/ppc4xx_setup.c renamed from linuxppc_2_4_devel/arch/ppc/kernel/ppc4xx_setup.c +3 -1
@@ -86,7 +86,7 @@#endif #define BOOT_WDT_DEFAULT_PERIOD 120/* 2 minutes */ -extern board_setup_arch (void); +extern void board_setup_arch (void );void __init ppc4xx_setup_arch (void )
@@ -165,6 +165,8 @@int len =0 ;bd_t *bip = (bd_t *)__res; + len +=sprintf (len + buffer, +"machine\t: %s\n" , PPC4xx_MACHINE_NAME);#ifdef CONFIG_STB03xxx len += sprintf(len + buffer, "plb bus clock\t: %dMHz\n",
include/asm-ppc/ppc4xx.h renamed from linuxppc_2_4_devel/include/asm-ppc/ppc4xx.h +4 -0
@@ -26,6 +26,10 @@#include <asm/walnut.h> #endif +#ifndef PPC4xx_MACHINE_NAME +#define PPC4xx_MACHINE_NAME "4xx" +#endif +/* IO_BASE is for PCI I/O. * ISA not supported, just here to resolve copilation. */
include/asm-ppc/walnut.h renamed from linuxppc_2_4_devel/include/asm-ppc/walnut.h +1 -0
@@ -78,6 +78,7 @@/* Generic 4xx type */ #define _MACH_4xx (_MACH_walnut) +#define PPC4xx_MACHINE_NAME "IBM Walnut"#endif /* __WALNUT_H__ */ #endif /* __KERNEL__ */
--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · Tom Rini
Quoted 6 lines · David Gibson
The patch below allows publishing the type of board the kernel is running on in
/proc/cpuinfo(under "machine") for 4xx machines. It displays Walnut boards as "IBM Walnut" and (currently) all others simply as "4xx". Adding other boards is trivial - just a #define in the relevant header file. It also eliminates a warning inppc4xx_setup.cSounds neat. But since a number of utils (some distro-specific) parse the machine: line, do you think something like:
Yes, the fact that things parse it is the main reason I thought to add it.
Quoted 6 lines
machine:\t\t<Core>: <Board>
ie:
405GP: IBM Walnut
405GP: EmbeddedPlanet
or
403CX: TiVo
I don't see why - this information already appears in the "cpu:" field and on machines that do have the "machine:" field it doesn't generally include processor type information.
Below is an updated patch. It improves the formatting (two '\t's instead of one), adds information for the Oak and ep405 boards, and fixes conflicts with some more recent updates.
arch/ppc/kernel/ppc4xx_setup.c renamed from linuxppc_2_4_devel/arch/ppc/kernel/ppc4xx_setup.c +3 -1
@@ -86,7 +86,7 @@#endif #define BOOT_WDT_DEFAULT_PERIOD 120/* 2 minutes */ -extern board_setup_arch (void); +extern void board_setup_arch (void );void __init ppc4xx_setup_arch (void )
@@ -165,6 +165,8 @@int len =0 ;bd_t *bip = (bd_t *)__res; + len +=sprintf (len + buffer, +"machine\t\t: %s\n" , PPC4xx_MACHINE_NAME);#ifdef CONFIG_STB03xxx len += sprintf(len + buffer, "plb bus clock\t: %dMHz\n",
include/asm-ppc/oak.h renamed from linuxppc_2_4_devel/include/asm-ppc/oak.h +2 -0
@@ -60,6 +60,8 @@unsigned int bi_busfreq;/* Bus speed, in Hz */ } bd_t; +#define PPC4xx_MACHINE_NAME "IBM Oak" +#endif /* !__ASSEMBLY__ */ #endif /* __OAK_H__ */ #endif /* __KERNEL__ */
include/asm-ppc/ppc4xx.h renamed from linuxppc_2_4_devel/include/asm-ppc/ppc4xx.h +4 -0
@@ -30,6 +30,10 @@#include <asm/ep405.h> #endif +#ifndef PPC4xx_MACHINE_NAME +#define PPC4xx_MACHINE_NAME "4xx" +#endif +/* IO_BASE is for PCI I/O. * ISA not supported, just here to resolve copilation. */
include/asm-ppc/walnut.h renamed from linuxppc_2_4_devel/include/asm-ppc/walnut.h +2 -0
@@ -69,5 +69,7 @@#define kbd_write_output (val) writeb(val, kb_data)#define kbd_write_command (val) writeb(val, kb_cs) +#define PPC4xx_MACHINE_NAME "IBM Walnut" +#endif /* __WALNUT_H__ */ #endif /* __KERNEL__ */
--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 1 line · David Gibson
On Fri, Sep 14, 2001 at 07:28:47AM -0700, Tom Rini wrote:
[snip]
Quoted 10 lines
Quoted 6 lines
machine:\t\t<Core>: <Board>
ie:
405GP: IBM Walnut
405GP: EmbeddedPlanet
or
403CX: TiVoI don't see why - this information already appears in the "cpu:" field and on machines that do have the "machine:" field it doesn't generally include processor type information.
Well, because they usually (at least what I can think of, but I haven't been on the userland side of things for a while) don't bother with the cpu field. Hence I was thinking of being able to case based on '405GP'* instead of per-board. Thats just my 2cents tho, take it for what you will.
I do wish someone else would speak up tho. Does anyone out there have an opinion?
--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 2 lines · Tom Rini
I do wish someone else would speak up tho. Does anyone out there have an opinion?
It depends how you want to use this information. In the kernel, it is very critical we clearly distinguish between the "core" (the thing that executes instructions), the peripherals (the real difference among the SOC-type processors), and the board design (which will determine how the peripherals are configured).
If the information from /proc is just used for pretty print out of information, I really don't care. If there are applications that read this for some internal configuration and flexibility, we better have a standard format.
-- Dan
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 6 lines · Dan Malek
Quoted 2 lines · Tom Rini
I do wish someone else would speak up tho. Does anyone out there have an opinion?
Quoted 6 lines
If the information from /proc is just used for pretty print out of information, I really don't care. If there are applications that read this for some internal configuration and flexibility, we better have a standard format.
-- Dan
Debian uses /proc/cpuinfo to find out what utility to use for the RTC (clock,hwclock). This could be fixed if the code from clock was integrated in hwclock. hwclock tries every method it knows until one works.
--
Kenneth Johansson
Ericsson Business Innovation AB Tel: +46 8 404 71 83
Viderögatan 3 Fax: +46 8 404 72 72
164 80 Stockholm [email protected]
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 7 lines · Kenneth Johansson
Quoted 6 lines · Dan Malek
Quoted 2 lines · Tom Rini
I do wish someone else would speak up tho. Does anyone out there have an opinion?
Quoted 7 lines
Quoted 4 lines
If the information from /proc is just used for pretty print out of information, I really don't care. If there are applications that read this for some internal configuration and flexibility, we better have a standard format.
Debian uses
/proc/cpuinfoto find out what utility to use for the RTC (clock,hwclock). This could be fixed if the code from clock was integrated in hwclock. hwclock tries every method it knows until one works.
This is no longer true. Woody anyways assumes that /dev/rtc will work in the 'standard' way. But,, debian does parse for machien type for doing board/platform specific modules.
--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 13 lines · Tom Rini
Quoted 11 lines · Kenneth Johansson
Quoted 10 lines · Dan Malek
Quoted 2 lines · Tom Rini
I do wish someone else would speak up tho. Does anyone out there have an opinion?
If the information from /proc is just used for pretty print out of information, I really don't care. If there are applications that read this for some internal configuration and flexibility, we better have a standard format.
Quoted 7 lines
Quoted 3 lines
Debian uses
/proc/cpuinfoto find out what utility to use for the RTC (clock,hwclock). This could be fixed if the code from clock was integrated in hwclock. hwclock tries every method it knows until one works.This is no longer true. Woody anyways assumes that
/dev/rtcwill work in the 'standard' way. But,, debian does parse for machien type for doing board/platform specific modules.
Yes, but last I checked the util-linux install script would still die if the machine: field wasn't present at all. IIRC it was checking for PReP machines for some reason.
--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 19 lines · David Gibson
Quoted 17 lines · Tom Rini
Quoted 14 lines · Kenneth Johansson
Quoted 10 lines · Dan Malek
Quoted 2 lines · Tom Rini
I do wish someone else would speak up tho. Does anyone out there have an opinion?
If the information from /proc is just used for pretty print out of information, I really don't care. If there are applications that read this for some internal configuration and flexibility, we better have a standard format.
Debian uses
/proc/cpuinfoto find out what utility to use for the RTC (clock,hwclock). This could be fixed if the code from clock was integrated in hwclock. hwclock tries every method it knows until one works.
Quoted 7 lines
Quoted 3 lines
This is no longer true. Woody anyways assumes that
/dev/rtcwill work in the 'standard' way. But,, debian does parse for machien type for doing board/platform specific modules.Yes, but last I checked the util-linux install script would still die if the machine: field wasn't present at all. IIRC it was checking for PReP machines for some reason.
util-linux is broken then. All PPC (save APUS) can have a working /dev/rtc, via CONFIG_PPC_RTC.
--
Tom Rini (TR1265)
http://gate.crashing.org/~trini/
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/
Quoted 12 lines · Dan Malek
Quoted 2 lines · Tom Rini
I do wish someone else would speak up tho. Does anyone out there have an opinion?
It depends how you want to use this information. In the kernel, it is very critical we clearly distinguish between the "core" (the thing that executes instructions), the peripherals (the real difference among the SOC-type processors), and the board design (which will determine how the peripherals are configured).
Quoted 4 lines
If the information from /proc is just used for pretty print out of information, I really don't care. If there are applications that read this for some internal configuration and flexibility, we better have a standard format.
I don't see that we need to structure the information in the machine:
field for this purpose though - if the core and peripherals information turns out to be important it belongs better in other fields of /proc/cpuinfo, I think. We already have cpu: and we could make a core: if it was necessary - or encode the core information into
cpu: it belongs there more than in machine: I think. Just the board type (and revision, where we can find that information) seems the closest match to what machine: gives on more normal PPC machines.
--
David Gibson | For every complex problem there is a
[email protected] | solution which is simple, neat and
| wrong. -- H.L. Mencken
http://www.ozlabs.org/people/dgibson
** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/