8xx: Add support for the MPC852 based board from keymile.
PATCH v2 1/1 8xx: Add support for the MPC852 based board from keymile.
Hello,
This add support of the mgsuvd board from keymile to arch/powerpc. Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx)
--- arch/powerpc/boot/dts/mgsuvd.dts | 158 +++++++ arch/powerpc/configs/mgsuvd_defconfig | 827 +++++++++++++++++++++++++++++++++ arch/powerpc/platforms/8xx/Kconfig | 7 + arch/powerpc/platforms/8xx/Makefile | 1 + arch/powerpc/platforms/8xx/mgsuvd.c | 135 ++++++ 5 files changed, 1128 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts create mode 100644 arch/powerpc/configs/mgsuvd_defconfig create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c
arch/powerpc/boot/dts/mgsuvd.dts new file +158 -0
@@ -0,0 +1,158 @@ +/* + * MGSUVD Device Tree Source + * + * Copyright 2008 DENX Software Engineering GmbH + * Heiko Schocher <[email protected]> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + + +/ { + model = "MGSUVD"; + compatible = "keymile,mgsuvd"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,852@0 { + device_type = "cpu"; + reg = <0>; + d-cache-line-size = <d#16>; + i-cache-line-size = <d#16>; + d-cache-size = <d#8192>; + i-cache-size = <d#8192>; + timebase-frequency = <0>; /* Filled in by u-boot */ + bus-frequency = <0>; /* Filled in by u-boot */ + clock-frequency = <0>; /* Filled in by u-boot */ + interrupts = <f 2>; /* decrementer interrupt */ + interrupt-parent = <&PIC>; + }; + }; + + memory { + device_type = "memory"; + reg = <00000000 4000000>; /* Filled in by u-boot */ + }; + + localbus@fff00100 { + compatible = "fsl,pq1-localbus"; + #address-cells = <2>; + #size-cells = <1>; + reg = <fff00100 40>; + + ranges = < + 0 0 f0000000 01000000 + >; /* Filled in by u-boot */ + + flash@0,0 { + compatible = "cfi-flash"; + reg = <0 0 1000000>; + #address-cells = <1>; + #size-cells = <1>; + bank-width = <1>; + device-width = <1>; + partition@0 { + label = "u-boot"; + reg = <0 80000>; + }; + partition@40000 { + label = "env"; + reg = <80000 20000>; + }; + partition@80000 { + label = "user"; + reg = <a0000 f60000>; + }; + }; + }; + + soc@fff00000 { + compatible = "fsl,mpc885", "fsl,pq1-soc"; + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + ranges = <0 fff00000 00004000>; + + PIC: interrupt-controller@0 { + interrupt-controller; + #interrupt-cells = <2>; + reg = <0 24>; + compatible = "fsl,pq1-pic"; + }; + + cpm@9c0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,cpm1"; + command-proc = <9c0>; + interrupts = <0>; /* cpm error interrupt */ + interrupt-parent = <&CPM_PIC>; + reg = <9c0 10>; + ranges; + + muram@2000 { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 2000 2000>; + + data@0 { + compatible = "fsl,cpm-muram-data"; + reg = <800 1800>; + }; + }; + + brg@9f0 { + compatible = "fsl,mpc885-brg", + "fsl,cpm1-brg", + "fsl,cpm-brg"; + reg = <9f0 10>; + clock-frequency = <3ef1480>; + }; + + CPM_PIC: interrupt-controller@930 { + interrupt-controller; + #interrupt-cells = <1>; + interrupts = <5 2 0 2 20 2>; + interrupt-parent = <&PIC>; + reg = <930 20>; + compatible = "fsl,cpm1-pic"; + }; + + /* MON-1 */ + serial@a80 { + device_type = "serial"; + compatible = "cpm_uart", + "fsl,cpm1-smc-uart"; + model = "SMC"; + device-id = <1>; + reg = <a80 10 3fc0 40>; + interrupts = <4>; + interrupt-parent = <&CPM_PIC>; + fsl,cpm-brg = <1>; + fsl,cpm-command = <0090>; + current-speed = <0>; /* Filled in by u-boot */ + }; + + ethernet@a40 { + device_type = "network"; + compatible = "fs_enet", + "fsl,cpm1-scc-enet"; + model = "SCC"; + device-id = <3>; + reg = <a40 18 3e00 b0>; + mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by u-boot */ + interrupts = <1c>; + interrupt-parent = <&CPM_PIC>; + fsl,cpm-command = <80>; + fixed-link = <0 0 a 0 0>; + }; + }; + }; +};
arch/powerpc/configs/mgsuvd_defconfig new file +827 -0
827 lines not on this page · raw message
arch/powerpc/platforms/8xx/Kconfig +7 -0
@@ -53,6 +53,13 @@ config PPC_ADDER875 This enables support for the Analogue & Micro Adder 875 board. +config PPC_MGSUVD + bool "MGSUVD" + select CPM1 + select PPC_CPM_NEW_BINDING + help + This enables support for the Keymile MGSUVD board. + endchoice menu "Freescale Ethernet driver platform-specific options"
arch/powerpc/platforms/8xx/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o obj-$(CONFIG_PPC_EP88XC) += ep88xc.o obj-$(CONFIG_PPC_ADDER875) += adder875.o +obj-$(CONFIG_PPC_MGSUVD) += mgsuvd.o
arch/powerpc/platforms/8xx/mgsuvd.c new file +135 -0
135 lines not on this page · raw message
Signature · 5 lines
1.5.4.2 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Hi Heiko,
Quoted 4 lines · On Fri, 14 Mar 2008 10:24:30 +0100 Heiko Schocher <[email protected]> wrote:
This add support of the mgsuvd board from keymile to
arch/powerpc. Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx)
Paul would probably like some description of the board here.
Quoted 3 lines
+++
b/arch/powerpc/platforms/8xx/mgsuvd.c+extern void
cpm_reset(void);
This declaration is in asm/cpm1.h
arch/powerpc/platforms/8xx/mgsuvd.c line 42
Quoted 3 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +3
-0+struct cpm_pin { +int port, pin, flags; +};
I wish someone would consolidate all these definitions of cpm_pin.
arch/powerpc/platforms/8xx/mgsuvd.c line 64
Quoted 8 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +8
-0+static void __init init_ioports (void ) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (mgsuvd_pins); i++) { +struct cpm_pin *pin = &mgsuvd_pins[i]; +cpm1_set_pin (pin->port, pin->pin, pin->flags); + }
And the code that uses them ...
arch/powerpc/platforms/8xx/mgsuvd.c line 80
Quoted 6 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +6
-0+static void __init mgsuvd_setup_arch (void ) +{ +struct device_node *cpu; + + cpu =of_find_node_by_type (NULL ,"cpu" ); +if (cpu !=0 ) {
"cpu" is a pointer, so "cpu != NULL" or just "cpu"
arch/powerpc/platforms/8xx/mgsuvd.c line 84
Quoted 4 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +4
-0+const unsigned int *fp; + + fp =of_get_property (cpu,"clock-frequency" ,NULL ); +if (fp !=0 )
Ditto for "fp" test
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
arch/powerpc/platforms/8xx/mgsuvd.c line 70
Quoted 5 lines · Heiko Schocher
arch/powerpc/platforms/8xx/mgsuvd.c new file +5
-0+setbits16 (&mpc8xx_immr->im_ioport.iop_pcso,0x300 ); +cpm1_clk_setup (CPM_CLK_SCC3 ,CPM_CLK5 ,CPM_CLK_RX ); +cpm1_clk_setup (CPM_CLK_SCC3 ,CPM_CLK6 ,CPM_CLK_TX ); +setbits32 (&mpc8xx_immr->im_cpm.cp_pbpar,0x300 ); +setbits32 (&mpc8xx_immr->im_cpm.cp_pbdir,0x300 );
Any particular reason not to use cpm1_set_pin() rather than those setbits?
Quoted 6 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +6
-0+static void __init mgsuvd_setup_arch (void ) +{ +struct device_node *cpu; + + cpu =of_find_node_by_type (NULL ,"cpu" ); +if (cpu !=0 ) {
arch/powerpc/platforms/8xx/mgsuvd.c line 90
Quoted 10 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +10
-0+const unsigned int *fp; + + fp =of_get_property (cpu,"clock-frequency" ,NULL ); +if (fp !=0 ) + loops_per_jiffy = *fp /HZ ; +else + loops_per_jiffy =50000000 /HZ ; +of_node_put (cpu); + } +
This is obsolete and unnecessary.
arch/powerpc/platforms/8xx/mgsuvd.c line 95
Quoted 1 line
arch/powerpc/platforms/8xx/mgsuvd.c new file +1
-0+ROOT_DEV = Root_NFS;
Likewise.
arch/powerpc/platforms/8xx/mgsuvd.c line 123
Quoted 11 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +11
-0+static int __init mgsuvd_probe (void ) +{ +char *model =of_get_flat_dt_prop (of_get_flat_dt_root (), +"model" ,NULL ); +if (model ==NULL ) +return 0 ; +if (strcmp (model,"MGSUVD" )) +return 0 ; + +return 1 ; +}
Check compatible (using of_flat_dt_is_compatible), not model.
-Scott
Hello Stephen,
Quoted 1 line · Stephen Rothwell
On Fri, 14 Mar 2008 10:24:30 +0100 Heiko Schocher <[email protected]> wrote:
[...]
Quoted 5 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 42
Quoted 3 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +3
-0+struct cpm_pin { +int port, pin, flags; +};I wish someone would consolidate all these definitions of
cpm_pin.
Hmm... do you mean something like, moving this struct in cpm1.h and ...
Quoted 10 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 64
Quoted 8 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +8
-0+static void __init init_ioports (void ) +{ +int i; + +for (i =0 ; i <ARRAY_SIZE (mgsuvd_pins); i++) { +struct cpm_pin *pin = &mgsuvd_pins[i]; +cpm1_set_pin (pin->port, pin->pin, pin->flags); + }And the code that uses them ...
making in arch/powerpc/sysdev/cpm1.c a functioncpm1_setup_pins (struct cpm_pin *pins) ?
Quoted 9 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 80
Quoted 6 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +6
-0+static void __init mgsuvd_setup_arch (void ) +{ +struct device_node *cpu; + + cpu =of_find_node_by_type (NULL ,"cpu" ); +if (cpu !=0 ) {"cpu" is a pointer, so "cpu != NULL" or just "cpu"
Quoted 6 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 84
Quoted 4 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +4
-0+const unsigned int *fp; + + fp =of_get_property (cpu,"clock-frequency" ,NULL ); +if (fp !=0 )Ditto for "fp" test
Its no longer necessary, thanks to Scott
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Hi Heiko,
Quoted 4 lines · On Tue, 18 Mar 2008 08:13:06 +0100 Heiko Schocher <[email protected]> wrote:
Quoted 1 line · Stephen Rothwell
On Fri, 14 Mar 2008 10:24:30 +0100 Heiko Schocher <[email protected]> wrote:
[...]
Quoted 8 lines
Quoted 5 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 42
Quoted 3 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +3
-0+struct cpm_pin { +int port, pin, flags; +};I wish someone would consolidate all these definitions of
cpm_pin.Hmm... do you mean something like, moving this struct in
cpm1.hand ...
Yes or somewhere else appropriate.
Quoted 9 lines
Quoted 6 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 64
Quoted 4 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +4
-0+for (i =0 ; i <ARRAY_SIZE (mgsuvd_pins); i++) { +struct cpm_pin *pin = &mgsuvd_pins[i]; +cpm1_set_pin (pin->port, pin->pin, pin->flags); + }And the code that uses them ...
making in
arch/powerpc/sysdev/cpm1.ca functioncpm1_setup_pins(structcpm_pin*pins) ?
Yes.
This is not necessary for your patch, but would be a nice cleanup later. N.B. this struct is alos used by users of cpm2_set_pin().
Signature · 3 lines
Cheers, Stephen Rothwell [email protected] http://www.canb.auug.org.au/~sfr/
Hello Stephen,
Quoted 18 lines · Stephen Rothwell
Quoted 9 lines · On Tue, 18 Mar 2008 08:13:06 +0100 Heiko Schocher <[email protected]> wrote:
Quoted 1 line · Stephen Rothwell
On Fri, 14 Mar 2008 10:24:30 +0100 Heiko Schocher <[email protected]> wrote:
[...]
Quoted 4 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 42
Quoted 3 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +3
-0+struct cpm_pin { +int port, pin, flags; +};I wish someone would consolidate all these definitions of
cpm_pin.Hmm... do you mean something like, moving this struct in
cpm1.hand ...Yes or somewhere else appropriate.
Quoted 5 lines
Quoted 5 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 64
Quoted 4 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +4
-0+for (i =0 ; i <ARRAY_SIZE (mgsuvd_pins); i++) { +struct cpm_pin *pin = &mgsuvd_pins[i]; +cpm1_set_pin (pin->port, pin->pin, pin->flags); + }And the code that uses them ...
Quoted 7 lines
Quoted 2 lines
making in
arch/powerpc/sysdev/cpm1.ca functioncpm1_setup_pins(structcpm_pin*pins) ?Yes.
This is not necessary for your patch, but would be a nice cleanup later. N.B. this struct is alos used by users of
cpm2_set_pin().
OK. Another thought about this. Shouldnt this table go in the dts? A device node like
cpm_pin {
pins = <port pin flags>;
};would be nice, or?
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
PATCH v3 1/1 8xx: Add support for the MPC852 based board from keymile.
In reply to Scott WoodHello,
Add support for the MPC852 based mgsuvd board from keymile to arch/powerpc. Supported SMC1 (serial console), SCC3 Ethernet (10Mbps hdx)
--- arch/powerpc/boot/dts/mgsuvd.dts | 158 +++++++ arch/powerpc/configs/mgsuvd_defconfig | 827 +++++++++++++++++++++++++++++++++ arch/powerpc/platforms/8xx/Kconfig | 7 + arch/powerpc/platforms/8xx/Makefile | 1 + arch/powerpc/platforms/8xx/mgsuvd.c | 97 ++++ 5 files changed, 1090 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/boot/dts/mgsuvd.dts create mode 100644 arch/powerpc/configs/mgsuvd_defconfig create mode 100644 arch/powerpc/platforms/8xx/mgsuvd.c
arch/powerpc/boot/dts/mgsuvd.dts new file +158 -0
@@ -0,0 +1,158 @@ +/* + * MGSUVD Device Tree Source + * + * Copyright 2008 DENX Software Engineering GmbH + * Heiko Schocher <[email protected]> + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation; either version 2 of the License, or (at your + * option) any later version. + */ + + +/ { + model = "MGSUVD"; + compatible = "keymile,mgsuvd"; + #address-cells = <1>; + #size-cells = <1>; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + + PowerPC,852@0 { + device_type = "cpu"; + reg = <0>; + d-cache-line-size = <d#16>; + i-cache-line-size = <d#16>; + d-cache-size = <d#8192>; + i-cache-size = <d#8192>; + timebase-frequency = <0>; /* Filled in by u-boot */ + bus-frequency = <0>; /* Filled in by u-boot */ + clock-frequency = <0>; /* Filled in by u-boot */ + interrupts = <f 2>; /* decrementer interrupt */ + interrupt-parent = <&PIC>; + }; + }; + + memory { + device_type = "memory"; + reg = <00000000 4000000>; /* Filled in by u-boot */ + }; + + localbus@fff00100 { + compatible = "fsl,pq1-localbus"; + #address-cells = <2>; + #size-cells = <1>; + reg = <fff00100 40>; + + ranges = < + 0 0 f0000000 01000000 + >; /* Filled in by u-boot */ + + flash@0,0 { + compatible = "cfi-flash"; + reg = <0 0 1000000>; + #address-cells = <1>; + #size-cells = <1>; + bank-width = <1>; + device-width = <1>; + partition@0 { + label = "u-boot"; + reg = <0 80000>; + }; + partition@40000 { + label = "env"; + reg = <80000 20000>; + }; + partition@80000 { + label = "user"; + reg = <a0000 f60000>; + }; + }; + }; + + soc@fff00000 { + compatible = "fsl,mpc885", "fsl,pq1-soc"; + #address-cells = <1>; + #size-cells = <1>; + device_type = "soc"; + ranges = <0 fff00000 00004000>; + + PIC: interrupt-controller@0 { + interrupt-controller; + #interrupt-cells = <2>; + reg = <0 24>; + compatible = "fsl,pq1-pic"; + }; + + cpm@9c0 { + #address-cells = <1>; + #size-cells = <1>; + compatible = "fsl,cpm1"; + command-proc = <9c0>; + interrupts = <0>; /* cpm error interrupt */ + interrupt-parent = <&CPM_PIC>; + reg = <9c0 10>; + ranges; + + muram@2000 { + #address-cells = <1>; + #size-cells = <1>; + ranges = <0 2000 2000>; + + data@0 { + compatible = "fsl,cpm-muram-data"; + reg = <800 1800>; + }; + }; + + brg@9f0 { + compatible = "fsl,mpc885-brg", + "fsl,cpm1-brg", + "fsl,cpm-brg"; + reg = <9f0 10>; + clock-frequency = <3ef1480>; + }; + + CPM_PIC: interrupt-controller@930 { + interrupt-controller; + #interrupt-cells = <1>; + interrupts = <5 2 0 2 20 2>; + interrupt-parent = <&PIC>; + reg = <930 20>; + compatible = "fsl,cpm1-pic"; + }; + + /* MON-1 */ + serial@a80 { + device_type = "serial"; + compatible = "cpm_uart", + "fsl,cpm1-smc-uart"; + model = "SMC"; + device-id = <1>; + reg = <a80 10 3fc0 40>; + interrupts = <4>; + interrupt-parent = <&CPM_PIC>; + fsl,cpm-brg = <1>; + fsl,cpm-command = <0090>; + current-speed = <0>; /* Filled in by u-boot */ + }; + + ethernet@a40 { + device_type = "network"; + compatible = "fs_enet", + "fsl,cpm1-scc-enet"; + model = "SCC"; + device-id = <3>; + reg = <a40 18 3e00 b0>; + mac-address = [ 00 00 00 00 00 00 ]; /* Filled in by u-boot */ + interrupts = <1c>; + interrupt-parent = <&CPM_PIC>; + fsl,cpm-command = <80>; + fixed-link = <0 0 a 0 0>; + }; + }; + }; +};
arch/powerpc/configs/mgsuvd_defconfig new file +827 -0
827 lines not on this page · raw message
arch/powerpc/platforms/8xx/Kconfig +7 -0
@@ -53,6 +53,13 @@ config PPC_ADDER875 This enables support for the Analogue & Micro Adder 875 board. +config PPC_MGSUVD + bool "MGSUVD" + select CPM1 + select PPC_CPM_NEW_BINDING + help + This enables support for the Keymile MGSUVD board. + endchoice menu "Freescale Ethernet driver platform-specific options"
arch/powerpc/platforms/8xx/Makefile +1 -0
@@ -6,3 +6,4 @@ obj-$(CONFIG_MPC885ADS) += mpc885ads_setup.o obj-$(CONFIG_MPC86XADS) += mpc86xads_setup.o obj-$(CONFIG_PPC_EP88XC) += ep88xc.o obj-$(CONFIG_PPC_ADDER875) += adder875.o +obj-$(CONFIG_PPC_MGSUVD) += mgsuvd.o
arch/powerpc/platforms/8xx/mgsuvd.c new file +97 -0
97 lines not on this page · raw message
Signature · 5 lines
1.5.4.2 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 8 lines · Heiko Schocher
OK. Another thought about this. Shouldnt this table go in the dts? A device node like
cpm_pin { pins = <port pin flags>; };would be nice, or?
Well, the device tree is a mechanism for communicating from the firmware to the kernel, and if we could control the firmware better we'd just make it set the pins properly to begin with. :-)
-Scott
Quoted 31 lines · On Tue, 18 Mar 2008 09:04:14 +0100 Heiko Schocher wrote:
Hello Stephen,
Quoted 20 lines · Stephen Rothwell
Quoted 10 lines · On Tue, 18 Mar 2008 08:13:06 +0100 Heiko Schocher <[email protected]> wrote:
Quoted 2 lines · Stephen Rothwell
On Fri, 14 Mar 2008 10:24:30 +0100 Heiko Schocher <[email protected]> wrote:
[...]
Quoted 4 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 42
Quoted 3 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +3
-0+struct cpm_pin { +int port, pin, flags; +};I wish someone would consolidate all these definitions of
cpm_pin.Hmm... do you mean something like, moving this struct in
cpm1.hand ...Yes or somewhere else appropriate.
Quoted 5 lines
Quoted 5 lines
arch/powerpc/platforms/8xx/mgsuvd.c line 64
Quoted 4 lines
arch/powerpc/platforms/8xx/mgsuvd.c new file +4
-0+for (i =0 ; i <ARRAY_SIZE (mgsuvd_pins); i++) { +struct cpm_pin *pin = &mgsuvd_pins[i]; +cpm1_set_pin (pin->port, pin->pin, pin->flags); + }And the code that uses them ...
Quoted 7 lines
Quoted 2 lines
making in
arch/powerpc/sysdev/cpm1.ca functioncpm1_setup_pins(structcpm_pin*pins) ?Yes.
This is not necessary for your patch, but would be a nice cleanup later. N.B. this struct is alos used by users of
cpm2_set_pin().
Quoted 9 lines
OK. Another thought about this. Shouldnt this table go in the dts? A device node like
cpm_pin { pins = <port pin flags>; };would be nice, or?
This has been a disputable question some time ago, and decided (or it looks like decided) that devtree describes hardware, and not the way it is configured at the moment. Therefor, best way for pin stuff is considered, as Scott mentioned, to set up stuff inside the firmware.
-Vitaly
Quoted 3 lines
bye,
Heiko
Dear Scott,
Quoted 4 lines · in message <[email protected]> you wrote:
Well, the device tree is a mechanism for communicating from the firmware to the kernel, and if we could control the firmware better we'd just make it set the pins properly to begin with. :-)
Is this just a comment, or do you oppose Heiko's suggestion?
Other uses of the device tree seem possible and reasonable, too. For example, we can use the device tree to configure the firmware (U-Boot in this case).
Using the device tree to describe the pin configuration of the hardware sounds easier to me than hard-coding it in some source (or header) file - no matter if this is in the kernel and/or in the firmware.
What do you think?
Best regards,
Wolfgang Denk
Signature · 5 lines
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: [email protected] A quarrel is quickly settled when deserted by one party; there is no battle unless there be two. - Seneca
Quoted 8 lines · Wolfgang Denk
Dear Scott,
Quoted 3 lines · in message <[email protected]> you wrote:
Well, the device tree is a mechanism for communicating from the firmware to the kernel, and if we could control the firmware better we'd just make it set the pins properly to begin with. :-)
Is this just a comment, or do you oppose Heiko's suggestion?
It was intended more as a gentle nudge to set up the pins in firmware when not constrained by existing firmwares in the field that must be supported.
Quoted 10 lines
Other uses of the device tree seem possible and reasonable, too. For example, we can use the device tree to configure the firmware (U-Boot in this case).
Using the device tree to describe the pin configuration of the hardware sounds easier to me than hard-coding it in some source (or header) file - no matter if this is in the kernel and/or in the firmware.
What do you think?
I'm fine with putting it in the device tree for firmware's benefit, though I'm not sure I fully agree with the "easier" bit until we get support for expressions and named constants in dts, so that the flags would be less opaque.
-Scott
Hello Vitaly,
Quoted 2 lines · Vitaly Bordug
On Tue, 18 Mar 2008 09:04:14 +0100
Heiko Schocher wrote:
[...]
Quoted 10 lines
Quoted 9 lines
OK. Another thought about this. Shouldnt this table go in the dts? A device node like
cpm_pin { pins = <port pin flags>; };would be nice, or?
This has been a disputable question some time ago, and decided (or it looks like decided) that devtree describes hardware, and not the way it is configured at the moment. Therefor, best way for pin stuff is considered, as Scott mentioned, to set up stuff inside the firmware.
OK, I dont want to start a new discusion about that, but I always thought (maybe learned, not sure anymore ;-) Linux should be as much independent as possible from the bootloader(=firmware). If the firmware doesnt make things right Linux maybe hang ... :-(
bye,
Heiko
Signature · 2 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany