* Re: [PATCH 4/9] add platform support for MPC837x MDS board
From: Stephen Rothwell @ 2007-10-11 1:05 UTC (permalink / raw)
To: Li Yang; +Cc: linuxppc-dev, paulus
In-Reply-To: <1192010804-20071-4-git-send-email-leoli@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 372 bytes --]
On Wed, 10 Oct 2007 18:06:39 +0800 Li Yang <leoli@freescale.com> wrote:
>
> +++ b/arch/powerpc/platforms/83xx/mpc837x_mds.c
>
> +#include <asm/of_platform.h>
You actually neeed linux/of.h (for of_ routines) and asm/prom.h (for
of_flat_dt_is_compatible).
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: [PATCH 3/9] add Freescale SerDes PHY support
From: Stephen Rothwell @ 2007-10-11 0:59 UTC (permalink / raw)
To: Li Yang; +Cc: linuxppc-dev, paulus
In-Reply-To: <1192010804-20071-3-git-send-email-leoli@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 303 bytes --]
On Wed, 10 Oct 2007 18:06:38 +0800 Li Yang <leoli@freescale.com> wrote:
>
> +++ b/arch/powerpc/sysdev/fsl_serdes.c
>
> +#include <asm/prom.h>
You actually want linux/of.h not asm/prom.h
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: Build failure on treeboot-walnut.cg
From: Paul Mackerras @ 2007-10-11 0:12 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, David Gibson
In-Reply-To: <470BA6ED.3020504@freescale.com>
Timur Tabi writes:
> Is this a new policy? Modules in the kernel are not built unless you want
> them. Even in arch/powerpc/platforms, only the specific platform file I'm
> targeting is built. So I don't really understand why you claim it's normal
> for platform-specific files to be built, regardless of the actual platform.
The wrapper script is intended to be a standalone tool which is
independent of the kernel configuration, and can be used separately
from the kernel build process.
> And frankly, I don't like this "policy". Build bugs for 4xx should not
> interfere in my 83xx development. I can't build any kernels now because of
> this bug!
I'm sure you're not actually that helpless. :) Just carry a patch to
arch/powerpc/boot/Makefile in your local tree.
Paul.
^ permalink raw reply
* Re: Hard hang in hypervisor!?
From: Paul Mackerras @ 2007-10-11 0:04 UTC (permalink / raw)
To: Linas Vepstas; +Cc: linuxppc-dev, Nathan Lynch
In-Reply-To: <20071009212810.GN4350@austin.ibm.com>
Linas Vepstas writes:
> Err .. it was cpu 0 that was spinlocked. Are interrupts not
> distributed?
We have some bogosities in the xics code that I noticed a couple of
days ago. Basically we only set the xics to distribute interrupts to
all cpus if (a) the affinity mask is equal to CPU_MASK_ALL (which has
ones in every bit position from 0 to NR_CPUS-1) and (b) all present
cpus are online (cpu_online_map == cpu_present_map). Otherwise we
direct interrupts to the first cpu in the affinity map. So you can
easily have the affinity mask containing all the online cpus and still
not get distributed interrupts.
So in your case it's quite possible that all interrupts were directed
to cpu 0.
Paul.
^ permalink raw reply
* [PATCH 2/2] ucc_geth: use rx-clock-name and tx-clock-name device tree properties
From: Timur Tabi @ 2007-10-10 22:37 UTC (permalink / raw)
To: galak, linuxppc-dev, netdev; +Cc: Timur Tabi
In-Reply-To: <11920558291655-git-send-email-timur@freescale.com>
This patch updates the ucc_geth device driver to check the new rx-clock-name
and tx-clock-name properties first. If present, it uses the new function
qe_clock_source() to obtain the clock source. Otherwise, it checks the
deprecated rx-clock and tx-clock properties.
The device trees for 832x, 836x, and 8568 have been updated to contain the
new property names only.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
This patch applies to Kumar's for-2.6.24 branch, on top of my other patch titled
"qe: add function qe_clock_source".
arch/powerpc/boot/dts/mpc832x_mds.dts | 8 ++--
arch/powerpc/boot/dts/mpc832x_rdb.dts | 8 ++--
arch/powerpc/boot/dts/mpc836x_mds.dts | 8 ++--
arch/powerpc/boot/dts/mpc8568mds.dts | 8 ++--
drivers/net/ucc_geth.c | 55 ++++++++++++++++++++++++++++++--
5 files changed, 67 insertions(+), 20 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index fcd333c..b57485b 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -217,8 +217,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <19>;
- tx-clock = <1a>;
+ rx-clock-name = "clk9";
+ tx-clock-name = "clk10";
phy-handle = < &phy3 >;
pio-handle = < &pio3 >;
};
@@ -238,8 +238,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <17>;
- tx-clock = <18>;
+ rx-clock-name = "clk7";
+ tx-clock-name = "clk8";
phy-handle = < &phy4 >;
pio-handle = < &pio4 >;
};
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..e68a08b 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -202,8 +202,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <20>;
- tx-clock = <13>;
+ rx-clock-name = "clk16";
+ tx-clock-name = "clk3";
phy-handle = <&phy00>;
pio-handle = <&ucc2pio>;
};
@@ -223,8 +223,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <19>;
- tx-clock = <1a>;
+ rx-clock-name = "clk9";
+ tx-clock-name = "clk10";
phy-handle = <&phy04>;
pio-handle = <&ucc3pio>;
};
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index fbd1573..7a54072 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -245,8 +245,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <19>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk9";
phy-handle = < &phy0 >;
phy-connection-type = "rgmii-id";
pio-handle = < &pio1 >;
@@ -267,8 +267,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <14>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk4";
phy-handle = < &phy1 >;
phy-connection-type = "rgmii-id";
pio-handle = < &pio2 >;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 5439437..cf45aab 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -333,8 +333,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <20>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk16";
pio-handle = <&pio1>;
phy-handle = <&phy0>;
phy-connection-type = "rgmii-id";
@@ -355,8 +355,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <20>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk16";
pio-handle = <&pio2>;
phy-handle = <&phy1>;
phy-connection-type = "rgmii-id";
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 7dedc96..9308397 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3827,6 +3827,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
int err, ucc_num, max_speed = 0;
const phandle *ph;
const unsigned int *prop;
+ const char *sprop;
const void *mac_addr;
phy_interface_t phy_interface;
static const int enet_to_speed[] = {
@@ -3859,10 +3860,56 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ug_info->uf_info.ucc_num = ucc_num;
- prop = of_get_property(np, "rx-clock", NULL);
- ug_info->uf_info.rx_clock = *prop;
- prop = of_get_property(np, "tx-clock", NULL);
- ug_info->uf_info.tx_clock = *prop;
+ sprop = of_get_property(np, "rx-clock-name", NULL);
+ if (sprop) {
+ ug_info->uf_info.rx_clock = qe_clock_source(sprop);
+ if ((ug_info->uf_info.rx_clock < QE_CLK_NONE) ||
+ (ug_info->uf_info.rx_clock > QE_CLK24)) {
+ printk(KERN_ERR
+ "ucc_geth: invalid rx-clock-name property\n");
+ return -EINVAL;
+ }
+ } else {
+ prop = of_get_property(np, "rx-clock", NULL);
+ if (!prop) {
+ /* If both rx-clock-name and rx-clock are missing,
+ we want to tell people to use rx-clock-name. */
+ printk(KERN_ERR
+ "ucc_geth: missing rx-clock-name property\n");
+ return -EINVAL;
+ }
+ if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
+ printk(KERN_ERR
+ "ucc_geth: invalid rx-clock propperty\n");
+ return -EINVAL;
+ }
+ ug_info->uf_info.rx_clock = *prop;
+ }
+
+ sprop = of_get_property(np, "tx-clock-name", NULL);
+ if (sprop) {
+ ug_info->uf_info.tx_clock = qe_clock_source(sprop);
+ if ((ug_info->uf_info.tx_clock < QE_CLK_NONE) ||
+ (ug_info->uf_info.tx_clock > QE_CLK24)) {
+ printk(KERN_ERR
+ "ucc_geth: invalid tx-clock-name property\n");
+ return -EINVAL;
+ }
+ } else {
+ prop = of_get_property(np, "rx-clock", NULL);
+ if (!prop) {
+ printk(KERN_ERR
+ "ucc_geth: mising tx-clock-name property\n");
+ return -EINVAL;
+ }
+ if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
+ printk(KERN_ERR
+ "ucc_geth: invalid tx-clock property\n");
+ return -EINVAL;
+ }
+ ug_info->uf_info.tx_clock = *prop;
+ }
+
err = of_address_to_resource(np, 0, &res);
if (err)
return -EINVAL;
--
1.5.2.4
^ permalink raw reply related
* [PATCH 1/2] qe: add function qe_clock_source
From: Timur Tabi @ 2007-10-10 22:37 UTC (permalink / raw)
To: galak, linuxppc-dev, netdev; +Cc: Timur Tabi
In-Reply-To: <11920558283326-git-send-email-timur@freescale.com>
Add function qe_clock_source() which takes a string containing the name of a
QE clock source (as is typically found in device trees) and returns the
matching enum qe_clock value.
Update booting-without-of.txt to indicate that the UCC properties rx-clock
and tx-clock are deprecated and replaced with rx-clock-name and tx-clock-name,
which use strings instead of numbers to indicate QE clock sources.
Update qe_setbrg() to take an enum qe_clock instead of an integer as its
first paramter.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
This patch applies to Kumar's for-2.6.24 branch.
Documentation/powerpc/booting-without-of.txt | 13 ++++
arch/powerpc/sysdev/qe_lib/qe.c | 41 ++++++++++-
include/asm-powerpc/qe.h | 95 +++++++++++++-------------
3 files changed, 99 insertions(+), 50 deletions(-)
diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
index 7a6c5f2..d8306ee 100644
--- a/Documentation/powerpc/booting-without-of.txt
+++ b/Documentation/powerpc/booting-without-of.txt
@@ -1615,6 +1615,19 @@ platforms are moved over to use the flattened-device-tree model.
- interrupt-parent : the phandle for the interrupt controller that
services interrupts for this device.
- pio-handle : The phandle for the Parallel I/O port configuration.
+ - rx-clock-name: the UCC receive clock source
+ "none": clock source is disabled
+ "brg1" through "brg16": clock source is BRG1-BRG16, respectively
+ "clk1" through "clk24": clock source is CLK1-CLK24, respectively
+ - tx-clock-name: the UCC transmit clock source
+ "none": clock source is disabled
+ "brg1" through "brg16": clock source is BRG1-BRG16, respectively
+ "clk1" through "clk24": clock source is CLK1-CLK24, respectively
+ The following two properties are deprecated. rx-clock has been replaced
+ with rx-clock-name, and tx-clock has been replaced with tx-clock-name.
+ Drivers that currently use the deprecated properties should continue to
+ do so, in order to support older device trees, but they should be updated
+ to check for the new properties first.
- rx-clock : represents the UCC receive clock source.
0x00 : clock source is disabled;
0x1~0x10 : clock source is BRG1~BRG16 respectively;
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 3d57d38..8551e74 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -167,7 +167,7 @@ unsigned int get_brg_clk(void)
/* Program the BRG to the given sampling rate and multiplier
*
- * @brg: the BRG, 1-16
+ * @brg: the BRG, QE_BRG1 - QE_BRG16
* @rate: the desired sampling rate
* @multiplier: corresponds to the value programmed in GUMR_L[RDCR] or
* GUMR_L[TDCR]. E.g., if this BRG is the RX clock, and GUMR_L[RDCR]=01,
@@ -175,11 +175,14 @@ unsigned int get_brg_clk(void)
*
* Also note that the value programmed into the BRGC register must be even.
*/
-void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
+void qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
{
u32 divisor, tempval;
u32 div16 = 0;
+ if ((brg < QE_BRG1) || (brg > QE_BRG16))
+ return;
+
divisor = get_brg_clk() / (rate * multiplier);
if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
@@ -196,8 +199,40 @@ void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
QE_BRGC_ENABLE | div16;
- out_be32(&qe_immr->brg.brgc[brg - 1], tempval);
+ out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
+}
+
+/* Convert a string to a QE clock source enum
+ *
+ * This function takes a string, typically from a property in the device
+ * tree, and returns the corresponding "enum qe_clock" value.
+*/
+enum qe_clock qe_clock_source(const char *source)
+{
+ unsigned int i;
+
+ if (strcasecmp(source, "none") == 0)
+ return QE_CLK_NONE;
+
+ if (strncasecmp(source, "brg", 3) == 0) {
+ i = simple_strtoul(source + 3, NULL, 10);
+ if ((i >= 1) && (i <= 16))
+ return (QE_BRG1 - 1) + i;
+ else
+ return QE_CLK_DUMMY;
+ }
+
+ if (strncasecmp(source, "clk", 3) == 0) {
+ i = simple_strtoul(source + 3, NULL, 10);
+ if ((i >= 1) && (i <= 24))
+ return (QE_CLK1 - 1) + i;
+ else
+ return QE_CLK_DUMMY;
+ }
+
+ return QE_CLK_DUMMY;
}
+EXPORT_SYMBOL(qe_clock_source);
/* Initialize SNUMs (thread serial numbers) according to
* QE Module Control chapter, SNUM table
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index 0dabe46..81403ee 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -28,6 +28,52 @@
#define MEM_PART_SECONDARY 1
#define MEM_PART_MURAM 2
+/* Clocks and BRGs */
+enum qe_clock {
+ QE_CLK_NONE = 0,
+ QE_BRG1, /* Baud Rate Generator 1 */
+ QE_BRG2, /* Baud Rate Generator 2 */
+ QE_BRG3, /* Baud Rate Generator 3 */
+ QE_BRG4, /* Baud Rate Generator 4 */
+ QE_BRG5, /* Baud Rate Generator 5 */
+ QE_BRG6, /* Baud Rate Generator 6 */
+ QE_BRG7, /* Baud Rate Generator 7 */
+ QE_BRG8, /* Baud Rate Generator 8 */
+ QE_BRG9, /* Baud Rate Generator 9 */
+ QE_BRG10, /* Baud Rate Generator 10 */
+ QE_BRG11, /* Baud Rate Generator 11 */
+ QE_BRG12, /* Baud Rate Generator 12 */
+ QE_BRG13, /* Baud Rate Generator 13 */
+ QE_BRG14, /* Baud Rate Generator 14 */
+ QE_BRG15, /* Baud Rate Generator 15 */
+ QE_BRG16, /* Baud Rate Generator 16 */
+ QE_CLK1, /* Clock 1 */
+ QE_CLK2, /* Clock 2 */
+ QE_CLK3, /* Clock 3 */
+ QE_CLK4, /* Clock 4 */
+ QE_CLK5, /* Clock 5 */
+ QE_CLK6, /* Clock 6 */
+ QE_CLK7, /* Clock 7 */
+ QE_CLK8, /* Clock 8 */
+ QE_CLK9, /* Clock 9 */
+ QE_CLK10, /* Clock 10 */
+ QE_CLK11, /* Clock 11 */
+ QE_CLK12, /* Clock 12 */
+ QE_CLK13, /* Clock 13 */
+ QE_CLK14, /* Clock 14 */
+ QE_CLK15, /* Clock 15 */
+ QE_CLK16, /* Clock 16 */
+ QE_CLK17, /* Clock 17 */
+ QE_CLK18, /* Clock 18 */
+ QE_CLK19, /* Clock 19 */
+ QE_CLK20, /* Clock 20 */
+ QE_CLK21, /* Clock 21 */
+ QE_CLK22, /* Clock 22 */
+ QE_CLK23, /* Clock 23 */
+ QE_CLK24, /* Clock 24 */
+ QE_CLK_DUMMY
+};
+
/* Export QE common operations */
extern void qe_reset(void);
extern int par_io_init(struct device_node *np);
@@ -38,7 +84,8 @@ extern int par_io_data_set(u8 port, u8 pin, u8 val);
/* QE internal API */
int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
-void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier);
+enum qe_clock qe_clock_source(const char *source);
+void qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
int qe_get_snum(void);
void qe_put_snum(u8 snum);
unsigned long qe_muram_alloc(int size, int align);
@@ -129,52 +176,6 @@ enum comm_dir {
COMM_DIR_RX_AND_TX = 3
};
-/* Clocks and BRGs */
-enum qe_clock {
- QE_CLK_NONE = 0,
- QE_BRG1, /* Baud Rate Generator 1 */
- QE_BRG2, /* Baud Rate Generator 2 */
- QE_BRG3, /* Baud Rate Generator 3 */
- QE_BRG4, /* Baud Rate Generator 4 */
- QE_BRG5, /* Baud Rate Generator 5 */
- QE_BRG6, /* Baud Rate Generator 6 */
- QE_BRG7, /* Baud Rate Generator 7 */
- QE_BRG8, /* Baud Rate Generator 8 */
- QE_BRG9, /* Baud Rate Generator 9 */
- QE_BRG10, /* Baud Rate Generator 10 */
- QE_BRG11, /* Baud Rate Generator 11 */
- QE_BRG12, /* Baud Rate Generator 12 */
- QE_BRG13, /* Baud Rate Generator 13 */
- QE_BRG14, /* Baud Rate Generator 14 */
- QE_BRG15, /* Baud Rate Generator 15 */
- QE_BRG16, /* Baud Rate Generator 16 */
- QE_CLK1, /* Clock 1 */
- QE_CLK2, /* Clock 2 */
- QE_CLK3, /* Clock 3 */
- QE_CLK4, /* Clock 4 */
- QE_CLK5, /* Clock 5 */
- QE_CLK6, /* Clock 6 */
- QE_CLK7, /* Clock 7 */
- QE_CLK8, /* Clock 8 */
- QE_CLK9, /* Clock 9 */
- QE_CLK10, /* Clock 10 */
- QE_CLK11, /* Clock 11 */
- QE_CLK12, /* Clock 12 */
- QE_CLK13, /* Clock 13 */
- QE_CLK14, /* Clock 14 */
- QE_CLK15, /* Clock 15 */
- QE_CLK16, /* Clock 16 */
- QE_CLK17, /* Clock 17 */
- QE_CLK18, /* Clock 18 */
- QE_CLK19, /* Clock 19 */
- QE_CLK20, /* Clock 20 */
- QE_CLK21, /* Clock 21 */
- QE_CLK22, /* Clock 22 */
- QE_CLK23, /* Clock 23 */
- QE_CLK24, /* Clock 24 */
- QE_CLK_DUMMY,
-};
-
/* QE CMXUCR Registers.
* There are two UCCs represented in each of the four CMXUCR registers.
* These values are for the UCC in the LSBs
--
1.5.2.4
^ permalink raw reply related
* [PATCH 0/2] QE clock source improvements
From: Timur Tabi @ 2007-10-10 22:37 UTC (permalink / raw)
To: galak, linuxppc-dev, netdev
(Replaces all previous versions of this patch)
This patch set adds a new property to make specifying QE clock sources
easier, adds a function to help parse the property, updates some other
functions to use an enum instead of an integer, and updates the ucc_geth
driver to take advantage of all this.
^ permalink raw reply
* Re: [PATCH 0/2] QE clock source improvements
From: Timur Tabi @ 2007-10-10 22:31 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, netdev
In-Reply-To: <1192054708946-git-send-email-timur@freescale.com>
Sorry, please ignore this set. Something got screwed up with the patches.
I'm going to resend.
Timur Tabi wrote:
> This patch set adds a new property to make specifying QE clock sources
> easier, adds a function to help parse the property, updates some other
> functions to use an enum instead of an integer, and updates the ucc_geth
> driver to take advantage of all this.
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--
Timur Tabi
Linux Kernel Developer @ Freescale
^ permalink raw reply
* [PATCH 1/2] qe: add function qe_clock_source
From: Timur Tabi @ 2007-10-10 22:18 UTC (permalink / raw)
To: galak, linuxppc-dev, netdev; +Cc: Timur Tabi
In-Reply-To: <1192054708946-git-send-email-timur@freescale.com>
Add function qe_clock_source() which takes a string containing the name of a
QE clock source (as is typically found in device trees) and returns the
matching enum qe_clock value.
Update booting-without-of.txt to indicate that the UCC properties rx-clock
and tx-clock are deprecated and replaced with rx-clock-name and tx-clock-name,
which use strings instead of numbers to indicate QE clock sources.
Update qe_setbrg() to take an enum qe_clock instead of an integer as its
first paramter.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
This patch applies to Kumar's for-2.6.24 branch.
arch/powerpc/sysdev/qe_lib/qe.c | 13 +++--
include/asm-powerpc/qe.h | 98 +++++++++++++++++++--------------------
2 files changed, 56 insertions(+), 55 deletions(-)
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 3ccd360..8551e74 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -167,7 +167,7 @@ unsigned int get_brg_clk(void)
/* Program the BRG to the given sampling rate and multiplier
*
- * @brg: the BRG, 1-16
+ * @brg: the BRG, QE_BRG1 - QE_BRG16
* @rate: the desired sampling rate
* @multiplier: corresponds to the value programmed in GUMR_L[RDCR] or
* GUMR_L[TDCR]. E.g., if this BRG is the RX clock, and GUMR_L[RDCR]=01,
@@ -175,11 +175,14 @@ unsigned int get_brg_clk(void)
*
* Also note that the value programmed into the BRGC register must be even.
*/
-void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
+void qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
{
u32 divisor, tempval;
u32 div16 = 0;
+ if ((brg < QE_BRG1) || (brg > QE_BRG16))
+ return;
+
divisor = get_brg_clk() / (rate * multiplier);
if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
@@ -196,7 +199,7 @@ void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
QE_BRGC_ENABLE | div16;
- out_be32(&qe_immr->brg.brgc[brg - 1], tempval);
+ out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
}
/* Convert a string to a QE clock source enum
@@ -214,7 +217,7 @@ enum qe_clock qe_clock_source(const char *source)
if (strncasecmp(source, "brg", 3) == 0) {
i = simple_strtoul(source + 3, NULL, 10);
if ((i >= 1) && (i <= 16))
- return QE_BRG1 + i - 1;
+ return (QE_BRG1 - 1) + i;
else
return QE_CLK_DUMMY;
}
@@ -222,7 +225,7 @@ enum qe_clock qe_clock_source(const char *source)
if (strncasecmp(source, "clk", 3) == 0) {
i = simple_strtoul(source + 3, NULL, 10);
if ((i >= 1) && (i <= 24))
- return QE_CLK1 + i - 1;
+ return (QE_CLK1 - 1) + i;
else
return QE_CLK_DUMMY;
}
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index 7d53750..81403ee 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -28,6 +28,52 @@
#define MEM_PART_SECONDARY 1
#define MEM_PART_MURAM 2
+/* Clocks and BRGs */
+enum qe_clock {
+ QE_CLK_NONE = 0,
+ QE_BRG1, /* Baud Rate Generator 1 */
+ QE_BRG2, /* Baud Rate Generator 2 */
+ QE_BRG3, /* Baud Rate Generator 3 */
+ QE_BRG4, /* Baud Rate Generator 4 */
+ QE_BRG5, /* Baud Rate Generator 5 */
+ QE_BRG6, /* Baud Rate Generator 6 */
+ QE_BRG7, /* Baud Rate Generator 7 */
+ QE_BRG8, /* Baud Rate Generator 8 */
+ QE_BRG9, /* Baud Rate Generator 9 */
+ QE_BRG10, /* Baud Rate Generator 10 */
+ QE_BRG11, /* Baud Rate Generator 11 */
+ QE_BRG12, /* Baud Rate Generator 12 */
+ QE_BRG13, /* Baud Rate Generator 13 */
+ QE_BRG14, /* Baud Rate Generator 14 */
+ QE_BRG15, /* Baud Rate Generator 15 */
+ QE_BRG16, /* Baud Rate Generator 16 */
+ QE_CLK1, /* Clock 1 */
+ QE_CLK2, /* Clock 2 */
+ QE_CLK3, /* Clock 3 */
+ QE_CLK4, /* Clock 4 */
+ QE_CLK5, /* Clock 5 */
+ QE_CLK6, /* Clock 6 */
+ QE_CLK7, /* Clock 7 */
+ QE_CLK8, /* Clock 8 */
+ QE_CLK9, /* Clock 9 */
+ QE_CLK10, /* Clock 10 */
+ QE_CLK11, /* Clock 11 */
+ QE_CLK12, /* Clock 12 */
+ QE_CLK13, /* Clock 13 */
+ QE_CLK14, /* Clock 14 */
+ QE_CLK15, /* Clock 15 */
+ QE_CLK16, /* Clock 16 */
+ QE_CLK17, /* Clock 17 */
+ QE_CLK18, /* Clock 18 */
+ QE_CLK19, /* Clock 19 */
+ QE_CLK20, /* Clock 20 */
+ QE_CLK21, /* Clock 21 */
+ QE_CLK22, /* Clock 22 */
+ QE_CLK23, /* Clock 23 */
+ QE_CLK24, /* Clock 24 */
+ QE_CLK_DUMMY
+};
+
/* Export QE common operations */
extern void qe_reset(void);
extern int par_io_init(struct device_node *np);
@@ -38,7 +84,8 @@ extern int par_io_data_set(u8 port, u8 pin, u8 val);
/* QE internal API */
int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
-void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier);
+enum qe_clock qe_clock_source(const char *source);
+void qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
int qe_get_snum(void);
void qe_put_snum(u8 snum);
unsigned long qe_muram_alloc(int size, int align);
@@ -129,55 +176,6 @@ enum comm_dir {
COMM_DIR_RX_AND_TX = 3
};
-/* Clocks and BRGs */
-enum qe_clock {
- QE_CLK_NONE = 0,
- QE_BRG1, /* Baud Rate Generator 1 */
- QE_BRG2, /* Baud Rate Generator 2 */
- QE_BRG3, /* Baud Rate Generator 3 */
- QE_BRG4, /* Baud Rate Generator 4 */
- QE_BRG5, /* Baud Rate Generator 5 */
- QE_BRG6, /* Baud Rate Generator 6 */
- QE_BRG7, /* Baud Rate Generator 7 */
- QE_BRG8, /* Baud Rate Generator 8 */
- QE_BRG9, /* Baud Rate Generator 9 */
- QE_BRG10, /* Baud Rate Generator 10 */
- QE_BRG11, /* Baud Rate Generator 11 */
- QE_BRG12, /* Baud Rate Generator 12 */
- QE_BRG13, /* Baud Rate Generator 13 */
- QE_BRG14, /* Baud Rate Generator 14 */
- QE_BRG15, /* Baud Rate Generator 15 */
- QE_BRG16, /* Baud Rate Generator 16 */
- QE_CLK1, /* Clock 1 */
- QE_CLK2, /* Clock 2 */
- QE_CLK3, /* Clock 3 */
- QE_CLK4, /* Clock 4 */
- QE_CLK5, /* Clock 5 */
- QE_CLK6, /* Clock 6 */
- QE_CLK7, /* Clock 7 */
- QE_CLK8, /* Clock 8 */
- QE_CLK9, /* Clock 9 */
- QE_CLK10, /* Clock 10 */
- QE_CLK11, /* Clock 11 */
- QE_CLK12, /* Clock 12 */
- QE_CLK13, /* Clock 13 */
- QE_CLK14, /* Clock 14 */
- QE_CLK15, /* Clock 15 */
- QE_CLK16, /* Clock 16 */
- QE_CLK17, /* Clock 17 */
- QE_CLK18, /* Clock 18 */
- QE_CLK19, /* Clock 19 */
- QE_CLK20, /* Clock 20 */
- QE_CLK21, /* Clock 21 */
- QE_CLK22, /* Clock 22 */
- QE_CLK23, /* Clock 23 */
- QE_CLK24, /* Clock 24 */
- QE_CLK_DUMMY
-};
-
-/* Convert a string to a QE clock source enum */
-enum qe_clock qe_clock_source(const char *source);
-
/* QE CMXUCR Registers.
* There are two UCCs represented in each of the four CMXUCR registers.
* These values are for the UCC in the LSBs
--
1.5.2.4
^ permalink raw reply related
* [PATCH 2/2] ucc_geth: use rx-clock-name and tx-clock-name device tree properties
From: Timur Tabi @ 2007-10-10 22:18 UTC (permalink / raw)
To: galak, linuxppc-dev, netdev; +Cc: Timur Tabi
In-Reply-To: <11920547093580-git-send-email-timur@freescale.com>
This patch updates the ucc_geth device driver to check the new rx-clock-name
and tx-clock-name properties first. If present, it uses the new function
qe_clock_source() to obtain the clock source. Otherwise, it checks the
deprecated rx-clock and tx-clock properties.
The device trees for 832x, 836x, and 8568 have been updated to contain the
new property names only.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
This patch applies to Kumar's for-2.6.24 branch, on top of my other patch titled
"qe: add function qe_clock_source".
arch/powerpc/boot/dts/mpc832x_mds.dts | 8 ++++----
arch/powerpc/boot/dts/mpc832x_rdb.dts | 8 ++++----
arch/powerpc/boot/dts/mpc836x_mds.dts | 8 ++++----
arch/powerpc/boot/dts/mpc8568mds.dts | 8 ++++----
drivers/net/ucc_geth.c | 12 +++++-------
5 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index fcd333c..b57485b 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -217,8 +217,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <19>;
- tx-clock = <1a>;
+ rx-clock-name = "clk9";
+ tx-clock-name = "clk10";
phy-handle = < &phy3 >;
pio-handle = < &pio3 >;
};
@@ -238,8 +238,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <17>;
- tx-clock = <18>;
+ rx-clock-name = "clk7";
+ tx-clock-name = "clk8";
phy-handle = < &phy4 >;
pio-handle = < &pio4 >;
};
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..e68a08b 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -202,8 +202,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <20>;
- tx-clock = <13>;
+ rx-clock-name = "clk16";
+ tx-clock-name = "clk3";
phy-handle = <&phy00>;
pio-handle = <&ucc2pio>;
};
@@ -223,8 +223,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <19>;
- tx-clock = <1a>;
+ rx-clock-name = "clk9";
+ tx-clock-name = "clk10";
phy-handle = <&phy04>;
pio-handle = <&ucc3pio>;
};
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index fbd1573..7a54072 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -245,8 +245,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <19>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk9";
phy-handle = < &phy0 >;
phy-connection-type = "rgmii-id";
pio-handle = < &pio1 >;
@@ -267,8 +267,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <14>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk4";
phy-handle = < &phy1 >;
phy-connection-type = "rgmii-id";
pio-handle = < &pio2 >;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 5439437..cf45aab 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -333,8 +333,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <20>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk16";
pio-handle = <&pio1>;
phy-handle = <&phy0>;
phy-connection-type = "rgmii-id";
@@ -355,8 +355,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <20>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk16";
pio-handle = <&pio2>;
phy-handle = <&phy1>;
phy-connection-type = "rgmii-id";
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index a147d6e..9308397 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3863,7 +3863,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
sprop = of_get_property(np, "rx-clock-name", NULL);
if (sprop) {
ug_info->uf_info.rx_clock = qe_clock_source(sprop);
- if ((ug_info->uf_info.rx_clock < QE_CLK1) ||
+ if ((ug_info->uf_info.rx_clock < QE_CLK_NONE) ||
(ug_info->uf_info.rx_clock > QE_CLK24)) {
printk(KERN_ERR
"ucc_geth: invalid rx-clock-name property\n");
@@ -3873,12 +3873,12 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
prop = of_get_property(np, "rx-clock", NULL);
if (!prop) {
/* If both rx-clock-name and rx-clock are missing,
- we want to tell people to use rx-clock-name. */
+ we want to tell people to use rx-clock-name. */
printk(KERN_ERR
"ucc_geth: missing rx-clock-name property\n");
return -EINVAL;
}
- if ((*prop < QE_CLK1) || (*prop > QE_CLK24)) {
+ if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
printk(KERN_ERR
"ucc_geth: invalid rx-clock propperty\n");
return -EINVAL;
@@ -3889,7 +3889,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
sprop = of_get_property(np, "tx-clock-name", NULL);
if (sprop) {
ug_info->uf_info.tx_clock = qe_clock_source(sprop);
- if ((ug_info->uf_info.tx_clock < QE_CLK1) ||
+ if ((ug_info->uf_info.tx_clock < QE_CLK_NONE) ||
(ug_info->uf_info.tx_clock > QE_CLK24)) {
printk(KERN_ERR
"ucc_geth: invalid tx-clock-name property\n");
@@ -3902,7 +3902,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
"ucc_geth: mising tx-clock-name property\n");
return -EINVAL;
}
- if ((*prop < QE_CLK1) || (*prop > QE_CLK24)) {
+ if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
printk(KERN_ERR
"ucc_geth: invalid tx-clock property\n");
return -EINVAL;
@@ -3910,8 +3910,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ug_info->uf_info.tx_clock = *prop;
}
- prop = of_get_property(np, "tx-clock", NULL);
- ug_info->uf_info.tx_clock = *prop;
err = of_address_to_resource(np, 0, &res);
if (err)
return -EINVAL;
--
1.5.2.4
^ permalink raw reply related
* [PATCH 0/2] QE clock source improvements
From: Timur Tabi @ 2007-10-10 22:18 UTC (permalink / raw)
To: galak, linuxppc-dev, netdev
This patch set adds a new property to make specifying QE clock sources
easier, adds a function to help parse the property, updates some other
functions to use an enum instead of an integer, and updates the ucc_geth
driver to take advantage of all this.
^ permalink raw reply
* [PATCH 1/2] qe: add function qe_clock_source
From: Timur Tabi @ 2007-10-10 22:12 UTC (permalink / raw)
To: linuxppc-dev, galak; +Cc: Timur Tabi
Add function qe_clock_source() which takes a string containing the name of a
QE clock source (as is typically found in device trees) and returns the
matching enum qe_clock value.
Update booting-without-of.txt to indicate that the UCC properties rx-clock
and tx-clock are deprecated and replaced with rx-clock-name and tx-clock-name,
which use strings instead of numbers to indicate QE clock sources.
Update qe_setbrg() to take an enum qe_clock instead of an integer as its
first paramter.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
This patch applies to Kumar's for-2.6.24 branch.
arch/powerpc/sysdev/qe_lib/qe.c | 13 +++--
include/asm-powerpc/qe.h | 98 +++++++++++++++++++--------------------
2 files changed, 56 insertions(+), 55 deletions(-)
diff --git a/arch/powerpc/sysdev/qe_lib/qe.c b/arch/powerpc/sysdev/qe_lib/qe.c
index 3ccd360..8551e74 100644
--- a/arch/powerpc/sysdev/qe_lib/qe.c
+++ b/arch/powerpc/sysdev/qe_lib/qe.c
@@ -167,7 +167,7 @@ unsigned int get_brg_clk(void)
/* Program the BRG to the given sampling rate and multiplier
*
- * @brg: the BRG, 1-16
+ * @brg: the BRG, QE_BRG1 - QE_BRG16
* @rate: the desired sampling rate
* @multiplier: corresponds to the value programmed in GUMR_L[RDCR] or
* GUMR_L[TDCR]. E.g., if this BRG is the RX clock, and GUMR_L[RDCR]=01,
@@ -175,11 +175,14 @@ unsigned int get_brg_clk(void)
*
* Also note that the value programmed into the BRGC register must be even.
*/
-void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
+void qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier)
{
u32 divisor, tempval;
u32 div16 = 0;
+ if ((brg < QE_BRG1) || (brg > QE_BRG16))
+ return;
+
divisor = get_brg_clk() / (rate * multiplier);
if (divisor > QE_BRGC_DIVISOR_MAX + 1) {
@@ -196,7 +199,7 @@ void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier)
tempval = ((divisor - 1) << QE_BRGC_DIVISOR_SHIFT) |
QE_BRGC_ENABLE | div16;
- out_be32(&qe_immr->brg.brgc[brg - 1], tempval);
+ out_be32(&qe_immr->brg.brgc[brg - QE_BRG1], tempval);
}
/* Convert a string to a QE clock source enum
@@ -214,7 +217,7 @@ enum qe_clock qe_clock_source(const char *source)
if (strncasecmp(source, "brg", 3) == 0) {
i = simple_strtoul(source + 3, NULL, 10);
if ((i >= 1) && (i <= 16))
- return QE_BRG1 + i - 1;
+ return (QE_BRG1 - 1) + i;
else
return QE_CLK_DUMMY;
}
@@ -222,7 +225,7 @@ enum qe_clock qe_clock_source(const char *source)
if (strncasecmp(source, "clk", 3) == 0) {
i = simple_strtoul(source + 3, NULL, 10);
if ((i >= 1) && (i <= 24))
- return QE_CLK1 + i - 1;
+ return (QE_CLK1 - 1) + i;
else
return QE_CLK_DUMMY;
}
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h
index 7d53750..81403ee 100644
--- a/include/asm-powerpc/qe.h
+++ b/include/asm-powerpc/qe.h
@@ -28,6 +28,52 @@
#define MEM_PART_SECONDARY 1
#define MEM_PART_MURAM 2
+/* Clocks and BRGs */
+enum qe_clock {
+ QE_CLK_NONE = 0,
+ QE_BRG1, /* Baud Rate Generator 1 */
+ QE_BRG2, /* Baud Rate Generator 2 */
+ QE_BRG3, /* Baud Rate Generator 3 */
+ QE_BRG4, /* Baud Rate Generator 4 */
+ QE_BRG5, /* Baud Rate Generator 5 */
+ QE_BRG6, /* Baud Rate Generator 6 */
+ QE_BRG7, /* Baud Rate Generator 7 */
+ QE_BRG8, /* Baud Rate Generator 8 */
+ QE_BRG9, /* Baud Rate Generator 9 */
+ QE_BRG10, /* Baud Rate Generator 10 */
+ QE_BRG11, /* Baud Rate Generator 11 */
+ QE_BRG12, /* Baud Rate Generator 12 */
+ QE_BRG13, /* Baud Rate Generator 13 */
+ QE_BRG14, /* Baud Rate Generator 14 */
+ QE_BRG15, /* Baud Rate Generator 15 */
+ QE_BRG16, /* Baud Rate Generator 16 */
+ QE_CLK1, /* Clock 1 */
+ QE_CLK2, /* Clock 2 */
+ QE_CLK3, /* Clock 3 */
+ QE_CLK4, /* Clock 4 */
+ QE_CLK5, /* Clock 5 */
+ QE_CLK6, /* Clock 6 */
+ QE_CLK7, /* Clock 7 */
+ QE_CLK8, /* Clock 8 */
+ QE_CLK9, /* Clock 9 */
+ QE_CLK10, /* Clock 10 */
+ QE_CLK11, /* Clock 11 */
+ QE_CLK12, /* Clock 12 */
+ QE_CLK13, /* Clock 13 */
+ QE_CLK14, /* Clock 14 */
+ QE_CLK15, /* Clock 15 */
+ QE_CLK16, /* Clock 16 */
+ QE_CLK17, /* Clock 17 */
+ QE_CLK18, /* Clock 18 */
+ QE_CLK19, /* Clock 19 */
+ QE_CLK20, /* Clock 20 */
+ QE_CLK21, /* Clock 21 */
+ QE_CLK22, /* Clock 22 */
+ QE_CLK23, /* Clock 23 */
+ QE_CLK24, /* Clock 24 */
+ QE_CLK_DUMMY
+};
+
/* Export QE common operations */
extern void qe_reset(void);
extern int par_io_init(struct device_node *np);
@@ -38,7 +84,8 @@ extern int par_io_data_set(u8 port, u8 pin, u8 val);
/* QE internal API */
int qe_issue_cmd(u32 cmd, u32 device, u8 mcn_protocol, u32 cmd_input);
-void qe_setbrg(unsigned int brg, unsigned int rate, unsigned int multiplier);
+enum qe_clock qe_clock_source(const char *source);
+void qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier);
int qe_get_snum(void);
void qe_put_snum(u8 snum);
unsigned long qe_muram_alloc(int size, int align);
@@ -129,55 +176,6 @@ enum comm_dir {
COMM_DIR_RX_AND_TX = 3
};
-/* Clocks and BRGs */
-enum qe_clock {
- QE_CLK_NONE = 0,
- QE_BRG1, /* Baud Rate Generator 1 */
- QE_BRG2, /* Baud Rate Generator 2 */
- QE_BRG3, /* Baud Rate Generator 3 */
- QE_BRG4, /* Baud Rate Generator 4 */
- QE_BRG5, /* Baud Rate Generator 5 */
- QE_BRG6, /* Baud Rate Generator 6 */
- QE_BRG7, /* Baud Rate Generator 7 */
- QE_BRG8, /* Baud Rate Generator 8 */
- QE_BRG9, /* Baud Rate Generator 9 */
- QE_BRG10, /* Baud Rate Generator 10 */
- QE_BRG11, /* Baud Rate Generator 11 */
- QE_BRG12, /* Baud Rate Generator 12 */
- QE_BRG13, /* Baud Rate Generator 13 */
- QE_BRG14, /* Baud Rate Generator 14 */
- QE_BRG15, /* Baud Rate Generator 15 */
- QE_BRG16, /* Baud Rate Generator 16 */
- QE_CLK1, /* Clock 1 */
- QE_CLK2, /* Clock 2 */
- QE_CLK3, /* Clock 3 */
- QE_CLK4, /* Clock 4 */
- QE_CLK5, /* Clock 5 */
- QE_CLK6, /* Clock 6 */
- QE_CLK7, /* Clock 7 */
- QE_CLK8, /* Clock 8 */
- QE_CLK9, /* Clock 9 */
- QE_CLK10, /* Clock 10 */
- QE_CLK11, /* Clock 11 */
- QE_CLK12, /* Clock 12 */
- QE_CLK13, /* Clock 13 */
- QE_CLK14, /* Clock 14 */
- QE_CLK15, /* Clock 15 */
- QE_CLK16, /* Clock 16 */
- QE_CLK17, /* Clock 17 */
- QE_CLK18, /* Clock 18 */
- QE_CLK19, /* Clock 19 */
- QE_CLK20, /* Clock 20 */
- QE_CLK21, /* Clock 21 */
- QE_CLK22, /* Clock 22 */
- QE_CLK23, /* Clock 23 */
- QE_CLK24, /* Clock 24 */
- QE_CLK_DUMMY
-};
-
-/* Convert a string to a QE clock source enum */
-enum qe_clock qe_clock_source(const char *source);
-
/* QE CMXUCR Registers.
* There are two UCCs represented in each of the four CMXUCR registers.
* These values are for the UCC in the LSBs
--
1.5.2.4
^ permalink raw reply related
* [PATCH 2/2] ucc_geth: use rx-clock-name and tx-clock-name device tree properties
From: Timur Tabi @ 2007-10-10 22:12 UTC (permalink / raw)
To: linuxppc-dev, galak; +Cc: Timur Tabi
In-Reply-To: <1192054340419-git-send-email-timur@freescale.com>
This patch updates the ucc_geth device driver to check the new rx-clock-name
and tx-clock-name properties first. If present, it uses the new function
qe_clock_source() to obtain the clock source. Otherwise, it checks the
deprecated rx-clock and tx-clock properties.
The device trees for 832x, 836x, and 8568 have been updated to contain the
new property names only.
Signed-off-by: Timur Tabi <timur@freescale.com>
---
This patch applies to Kumar's for-2.6.24 branch, on top of my other patch titled
"qe: add function qe_clock_source".
arch/powerpc/boot/dts/mpc832x_mds.dts | 8 ++++----
arch/powerpc/boot/dts/mpc832x_rdb.dts | 8 ++++----
arch/powerpc/boot/dts/mpc836x_mds.dts | 8 ++++----
arch/powerpc/boot/dts/mpc8568mds.dts | 8 ++++----
drivers/net/ucc_geth.c | 12 +++++-------
5 files changed, 21 insertions(+), 23 deletions(-)
diff --git a/arch/powerpc/boot/dts/mpc832x_mds.dts b/arch/powerpc/boot/dts/mpc832x_mds.dts
index fcd333c..b57485b 100644
--- a/arch/powerpc/boot/dts/mpc832x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc832x_mds.dts
@@ -217,8 +217,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <19>;
- tx-clock = <1a>;
+ rx-clock-name = "clk9";
+ tx-clock-name = "clk10";
phy-handle = < &phy3 >;
pio-handle = < &pio3 >;
};
@@ -238,8 +238,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <17>;
- tx-clock = <18>;
+ rx-clock-name = "clk7";
+ tx-clock-name = "clk8";
phy-handle = < &phy4 >;
pio-handle = < &pio4 >;
};
diff --git a/arch/powerpc/boot/dts/mpc832x_rdb.dts b/arch/powerpc/boot/dts/mpc832x_rdb.dts
index 388c8a7..e68a08b 100644
--- a/arch/powerpc/boot/dts/mpc832x_rdb.dts
+++ b/arch/powerpc/boot/dts/mpc832x_rdb.dts
@@ -202,8 +202,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <20>;
- tx-clock = <13>;
+ rx-clock-name = "clk16";
+ tx-clock-name = "clk3";
phy-handle = <&phy00>;
pio-handle = <&ucc2pio>;
};
@@ -223,8 +223,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <19>;
- tx-clock = <1a>;
+ rx-clock-name = "clk9";
+ tx-clock-name = "clk10";
phy-handle = <&phy04>;
pio-handle = <&ucc3pio>;
};
diff --git a/arch/powerpc/boot/dts/mpc836x_mds.dts b/arch/powerpc/boot/dts/mpc836x_mds.dts
index fbd1573..7a54072 100644
--- a/arch/powerpc/boot/dts/mpc836x_mds.dts
+++ b/arch/powerpc/boot/dts/mpc836x_mds.dts
@@ -245,8 +245,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <19>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk9";
phy-handle = < &phy0 >;
phy-connection-type = "rgmii-id";
pio-handle = < &pio1 >;
@@ -267,8 +267,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <14>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk4";
phy-handle = < &phy1 >;
phy-connection-type = "rgmii-id";
pio-handle = < &pio2 >;
diff --git a/arch/powerpc/boot/dts/mpc8568mds.dts b/arch/powerpc/boot/dts/mpc8568mds.dts
index 5439437..cf45aab 100644
--- a/arch/powerpc/boot/dts/mpc8568mds.dts
+++ b/arch/powerpc/boot/dts/mpc8568mds.dts
@@ -333,8 +333,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <20>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk16";
pio-handle = <&pio1>;
phy-handle = <&phy0>;
phy-connection-type = "rgmii-id";
@@ -355,8 +355,8 @@
*/
mac-address = [ 00 00 00 00 00 00 ];
local-mac-address = [ 00 00 00 00 00 00 ];
- rx-clock = <0>;
- tx-clock = <20>;
+ rx-clock-name = "none";
+ tx-clock-name = "clk16";
pio-handle = <&pio2>;
phy-handle = <&phy1>;
phy-connection-type = "rgmii-id";
diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index a147d6e..9308397 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3863,7 +3863,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
sprop = of_get_property(np, "rx-clock-name", NULL);
if (sprop) {
ug_info->uf_info.rx_clock = qe_clock_source(sprop);
- if ((ug_info->uf_info.rx_clock < QE_CLK1) ||
+ if ((ug_info->uf_info.rx_clock < QE_CLK_NONE) ||
(ug_info->uf_info.rx_clock > QE_CLK24)) {
printk(KERN_ERR
"ucc_geth: invalid rx-clock-name property\n");
@@ -3873,12 +3873,12 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
prop = of_get_property(np, "rx-clock", NULL);
if (!prop) {
/* If both rx-clock-name and rx-clock are missing,
- we want to tell people to use rx-clock-name. */
+ we want to tell people to use rx-clock-name. */
printk(KERN_ERR
"ucc_geth: missing rx-clock-name property\n");
return -EINVAL;
}
- if ((*prop < QE_CLK1) || (*prop > QE_CLK24)) {
+ if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
printk(KERN_ERR
"ucc_geth: invalid rx-clock propperty\n");
return -EINVAL;
@@ -3889,7 +3889,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
sprop = of_get_property(np, "tx-clock-name", NULL);
if (sprop) {
ug_info->uf_info.tx_clock = qe_clock_source(sprop);
- if ((ug_info->uf_info.tx_clock < QE_CLK1) ||
+ if ((ug_info->uf_info.tx_clock < QE_CLK_NONE) ||
(ug_info->uf_info.tx_clock > QE_CLK24)) {
printk(KERN_ERR
"ucc_geth: invalid tx-clock-name property\n");
@@ -3902,7 +3902,7 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
"ucc_geth: mising tx-clock-name property\n");
return -EINVAL;
}
- if ((*prop < QE_CLK1) || (*prop > QE_CLK24)) {
+ if ((*prop < QE_CLK_NONE) || (*prop > QE_CLK24)) {
printk(KERN_ERR
"ucc_geth: invalid tx-clock property\n");
return -EINVAL;
@@ -3910,8 +3910,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
ug_info->uf_info.tx_clock = *prop;
}
- prop = of_get_property(np, "tx-clock", NULL);
- ug_info->uf_info.tx_clock = *prop;
err = of_address_to_resource(np, 0, &res);
if (err)
return -EINVAL;
--
1.5.2.4
^ permalink raw reply related
* Re: irq identification has changed from 2.6.10 to 2.6.23. an explanation is requested
From: Scott Wood @ 2007-10-10 20:47 UTC (permalink / raw)
To: Eno 3 Compton; +Cc: linuxppc-dev
In-Reply-To: <f6c0dc290710101339t30a15881t3ffbe02324006b28@mail.gmail.com>
Eno 3 Compton wrote:
> I had a driver working under 2.6.10 on a mpc8248. The kernel got changed
> under me to 2.6.23. Now, when I call request_irq with SIU_INT_IRQ5,
> which is defined in asm-powerpc/irq.h, and once compiled and worked
> properly, I get compilation errors. The compiler can't find the symbol
> definition because CONFIG_PPC_MERGE is defined. I suspect the kernel
> guys have migrated things to a new arrangement, which I've been unable
> to discern.
>
> An explanation or advice on where to find information about this would
> be hugely appreciated.
Ideally, you should put whatever device you're trying to drive in the
device tree, and use of_irq_to_resource() on the device node to find the
virtual IRQ number.
Failing that, you can call irq_find_mapping(), but you'll need to either
pass in the device node of the relevant interrupt controller, or call
irq_set_default_host() -- but really, it's better to just use the device
tree.
-Scott
^ permalink raw reply
* irq identification has changed from 2.6.10 to 2.6.23. an explanation is requested
From: Eno 3 Compton @ 2007-10-10 20:39 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 552 bytes --]
Dear All,
I had a driver working under 2.6.10 on a mpc8248. The kernel got changed
under me to 2.6.23. Now, when I call request_irq with SIU_INT_IRQ5, which is
defined in asm-powerpc/irq.h, and once compiled and worked properly, I get
compilation errors. The compiler can't find the symbol definition because
CONFIG_PPC_MERGE is defined. I suspect the kernel guys have migrated things
to a new arrangement, which I've been unable to discern.
An explanation or advice on where to find information about this would be
hugely appreciated.
Eno Compton
[-- Attachment #2: Type: text/html, Size: 588 bytes --]
^ permalink raw reply
* Re: [PATCH] Device tree bindings for Xilinx devices
From: Josh Boyer @ 2007-10-10 20:38 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev
In-Reply-To: <20071008075127.9887.38702.stgit@trillian.cg.shawcable.net>
On Mon, 2007-10-08 at 01:53 -0600, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
> This is a first draft, please review and comment.
I'll start off with the fact that I hardly consider myself a DT expert,
so take what I say with a grain of salt.
> On a side node, I think booting-without-of.txt could get really unwieldly
> in the near future. Perhaps the device tree bindings should be organized
> differently and separated from the functional description of device tree
> usage. Thoughts?
>
> Cheers,
> g.
>
> Documentation/powerpc/booting-without-of.txt | 58 ++++++++++++++++++++++++++
> 1 files changed, 58 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
> index 20e0e6c..a6d6056 100644
> --- a/Documentation/powerpc/booting-without-of.txt
> +++ b/Documentation/powerpc/booting-without-of.txt
> @@ -1850,6 +1850,64 @@ platforms are moved over to use the flattened-device-tree model.
>
> More devices will be defined as this spec matures.
>
> + l) Xilinx ML300 Framebuffer
> +
> + Simple framebuffer device from the ML300 reference design (also on the
> + ML403 reference design as well as others).
> +
> + Required properties:
> + - compatible : Must include "xilinx,ml300-fb"
Similarly, "xilinx,ml403-fb" will be required for ML403 correct? Or do
they share exact identical implementations?
> + - reg : offset and length of the framebuffer register set
> +
> + Optional properties:
> + - resolution : <xres yres> pixel resolution of framebuffer. Some
> + implementations use a different resolution. Default
> + is <d#640 d#480>
> + - virt-resolution : <xvirt yvirt> Size of framebuffer in memory.
> + Default is <d#1024 d#480>.
> + - rotate-display : rotate display 180 degrees.
> + - display-number : Logical number of display
> +
> + m) Xilinx SystemACE
> +
> + The Xilinx SystemACE device is used to program FPGAs from an FPGA
> + bitstream stored on a CF card. It can also be used as a generic CF
> + interface device.
> +
> + Required properties:
> + - compatible : Must include "xilinx,sysace"
> + - reg : offset and length of SystemACE register set
> +
> + Recommended properties:
> + - interrupt-parent, interrupts : Connection of device irq signal.
> +
> + Optional properties:
> + - number : logical number of the SystemACE device based at 0.
"number" seems a bit to generic to me. logical-number seems a bit more
descriptive.
> + - 8-bit (empty) : Set this property if the SystemACE must be in 8 bit mode
> +
> + n) Xilinx EMAC and Xilinx TEMAC
> +
> + Xilinx Ethernet devices. Uses common properties from other Ethernet
> + devices with the following constraints:
> +
> + Required properties:
> + - compatible : Must include one of: "xilinx,plb-temac",
> + "xilinx,plb-emac", "xilinx-opb-emac"
I think you mean "xilinx,opb-emac" on that last one.
> + - dma-mode : Must be one of "none", "simple", "sg" (sg == scatter gather)
> +
> + o) Xilinx Uartlite
> +
> + Xilinx uartlite devices are simple fixed speed serial ports. Uartlite
> + ports should be described in a node with the following properties.
> +
> + Requred properties:
> + - compatible : Must include "xilinx,uartlite"
> + - reg : offset and length of uartlite register set
> +
> + Recommended properties:
> + - port-number : logical port number of uartlite device based at 0.
> + - interrupt-parent, interrupts : Connection of device irq signal.
> +
josh
^ permalink raw reply
* Re: [PATCH 2/3] Remove empty ppc_md.setup_arch hooks.
From: Josh Boyer @ 2007-10-10 20:28 UTC (permalink / raw)
To: Grant Likely; +Cc: arnd, linuxppc-dev, paulus
In-Reply-To: <20071010184823.13609.41058.stgit@trillian.cg.shawcable.net>
On Wed, 2007-10-10 at 12:48 -0600, Grant Likely wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
Assuming Paul likes the overall change, the 4xx parts look fine to me.
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Acked-by: Josh Boyer <jwboyer@linux.vnet.ibm.com>
> ---
>
> arch/powerpc/platforms/40x/virtex.c | 5 -----
> arch/powerpc/platforms/40x/walnut.c | 5 -----
> arch/powerpc/platforms/44x/bamboo.c | 5 -----
> arch/powerpc/platforms/44x/ebony.c | 5 -----
> arch/powerpc/platforms/44x/sequoia.c | 5 -----
> 5 files changed, 0 insertions(+), 25 deletions(-)
>
> diff --git a/arch/powerpc/platforms/40x/virtex.c b/arch/powerpc/platforms/40x/virtex.c
> index b52aa94..14bbc32 100644
> --- a/arch/powerpc/platforms/40x/virtex.c
> +++ b/arch/powerpc/platforms/40x/virtex.c
> @@ -36,14 +36,9 @@ static int __init virtex_probe(void)
> return 1;
> }
>
> -static void __init virtex_setup_arch(void)
> -{
> -}
> -
> define_machine(virtex) {
> .name = "Xilinx Virtex",
> .probe = virtex_probe,
> - .setup_arch = virtex_setup_arch,
> .init_IRQ = xilinx_intc_init_tree,
> .get_irq = xilinx_intc_get_irq,
> .calibrate_decr = generic_calibrate_decr,
> diff --git a/arch/powerpc/platforms/40x/walnut.c b/arch/powerpc/platforms/40x/walnut.c
> index c17fdf2..eb0c136 100644
> --- a/arch/powerpc/platforms/40x/walnut.c
> +++ b/arch/powerpc/platforms/40x/walnut.c
> @@ -53,14 +53,9 @@ static int __init walnut_probe(void)
> return 1;
> }
>
> -static void __init walnut_setup_arch(void)
> -{
> -}
> -
> define_machine(walnut) {
> .name = "Walnut",
> .probe = walnut_probe,
> - .setup_arch = walnut_setup_arch,
> .progress = udbg_progress,
> .init_IRQ = uic_init_tree,
> .get_irq = uic_get_irq,
> diff --git a/arch/powerpc/platforms/44x/bamboo.c b/arch/powerpc/platforms/44x/bamboo.c
> index 9bc45de..470e1a3 100644
> --- a/arch/powerpc/platforms/44x/bamboo.c
> +++ b/arch/powerpc/platforms/44x/bamboo.c
> @@ -50,14 +50,9 @@ static int __init bamboo_probe(void)
> return 1;
> }
>
> -static void __init bamboo_setup_arch(void)
> -{
> -}
> -
> define_machine(bamboo) {
> .name = "Bamboo",
> .probe = bamboo_probe,
> - .setup_arch = bamboo_setup_arch,
> .progress = udbg_progress,
> .init_IRQ = uic_init_tree,
> .get_irq = uic_get_irq,
> diff --git a/arch/powerpc/platforms/44x/ebony.c b/arch/powerpc/platforms/44x/ebony.c
> index 5a7fec8..40e18fc 100644
> --- a/arch/powerpc/platforms/44x/ebony.c
> +++ b/arch/powerpc/platforms/44x/ebony.c
> @@ -57,14 +57,9 @@ static int __init ebony_probe(void)
> return 1;
> }
>
> -static void __init ebony_setup_arch(void)
> -{
> -}
> -
> define_machine(ebony) {
> .name = "Ebony",
> .probe = ebony_probe,
> - .setup_arch = ebony_setup_arch,
> .progress = udbg_progress,
> .init_IRQ = uic_init_tree,
> .get_irq = uic_get_irq,
> diff --git a/arch/powerpc/platforms/44x/sequoia.c b/arch/powerpc/platforms/44x/sequoia.c
> index 7d0d9d5..30700b3 100644
> --- a/arch/powerpc/platforms/44x/sequoia.c
> +++ b/arch/powerpc/platforms/44x/sequoia.c
> @@ -50,14 +50,9 @@ static int __init sequoia_probe(void)
> return 1;
> }
>
> -static void __init sequoia_setup_arch(void)
> -{
> -}
> -
> define_machine(sequoia) {
> .name = "Sequoia",
> .probe = sequoia_probe,
> - .setup_arch = sequoia_setup_arch,
> .progress = udbg_progress,
> .init_IRQ = uic_init_tree,
> .get_irq = uic_get_irq,
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
^ permalink raw reply
* Re: [PATCH 2/3] [POWERPC] Add AMCC Kilauea eval board support to platforms/40x
From: Josh Boyer @ 2007-10-10 20:23 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
In-Reply-To: <200710081108.51625.sr@denx.de>
On Mon, 2007-10-08 at 11:08 +0200, Stefan Roese wrote:
> This patch adds basic support for the new 405EX and the AMCC eval board
> Kilauea to arch/powerpc.
>
> Signed-off-by: Stefan Roese <sr@denx.de>
> ---
> arch/powerpc/platforms/40x/Kconfig | 17 +++++++--
> arch/powerpc/platforms/40x/Makefile | 5 ++-
> arch/powerpc/platforms/40x/kilauea.c | 63 ++++++++++++++++++++++++++++++++++
> 3 files changed, 80 insertions(+), 5 deletions(-)
> create mode 100644 arch/powerpc/platforms/40x/kilauea.c
>
> diff --git a/arch/powerpc/platforms/40x/Kconfig b/arch/powerpc/platforms/40x/Kconfig
> index a0a50b1..da8d02d 100644
> --- a/arch/powerpc/platforms/40x/Kconfig
> +++ b/arch/powerpc/platforms/40x/Kconfig
> @@ -29,6 +29,14 @@
> # help
> # This option enables support for the extra features of the EP405PC board.
>
> +config KILAUEA
> + bool "Kilauea"
> + depends on 40x
> + default y
I think we decided to say default n here. I need to fix the Walnut
example, I know.
> + select 405EX
> + help
> + This option enables support for the AMCC PPC405EX evaluation board.
> +
> #config REDWOOD_5
> # bool "Redwood-5"
> # depends on 40x
> @@ -89,14 +97,17 @@ config 403GCX
> #depends on OAK
> select IBM405_ERR51
>
> +config 405EP
> + bool
> +
> +config 405EX
> + bool
> +
> config 405GP
> bool
> select IBM405_ERR77
> select IBM405_ERR51
>
> -config 405EP
> - bool
> -
> config 405GPR
> bool
>
> diff --git a/arch/powerpc/platforms/40x/Makefile b/arch/powerpc/platforms/40x/Makefile
> index 0a3cfe9..51dadee 100644
> --- a/arch/powerpc/platforms/40x/Makefile
> +++ b/arch/powerpc/platforms/40x/Makefile
> @@ -1,2 +1,3 @@
> -obj-$(CONFIG_WALNUT) += walnut.o
> -obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o
> +obj-$(CONFIG_KILAUEA) += kilauea.o
> +obj-$(CONFIG_WALNUT) += walnut.o
> +obj-$(CONFIG_XILINX_VIRTEX_GENERIC_BOARD) += virtex.o
> diff --git a/arch/powerpc/platforms/40x/kilauea.c b/arch/powerpc/platforms/40x/kilauea.c
> new file mode 100644
> index 0000000..6cbd528
> --- /dev/null
> +++ b/arch/powerpc/platforms/40x/kilauea.c
> @@ -0,0 +1,63 @@
> +/*
> + * Kilauea board specific routines
> + *
> + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
> + *
> + * Based on the Walnut code by
> + * Josh Boyer <jwboyer@linux.vnet.ibm.com>
> + * Copyright 2007 IBM Corporation
> + *
> + * 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.
> + */
> +#include <linux/init.h>
> +#include <asm/machdep.h>
> +#include <asm/prom.h>
> +#include <asm/udbg.h>
> +#include <asm/time.h>
> +#include <asm/uic.h>
> +#include <asm/of_platform.h>
> +
> +static struct of_device_id kilauea_of_bus[] = {
> + { .compatible = "ibm,plb4", },
> + { .compatible = "ibm,opb", },
> + { .compatible = "ibm,ebc", },
> + {},
> +};
> +
> +static int __init kilauea_device_probe(void)
> +{
> + if (!machine_is(kilauea))
> + return 0;
> +
> + of_platform_bus_probe(NULL, kilauea_of_bus, NULL);
> +
> + return 0;
> +}
> +device_initcall(kilauea_device_probe);
> +
> +static int __init kilauea_probe(void)
> +{
> + unsigned long root = of_get_flat_dt_root();
> +
> + if (!of_flat_dt_is_compatible(root, "amcc,kilauea"))
> + return 0;
> +
> + return 1;
> +}
> +
> +static void __init kilauea_setup_arch(void)
> +{
> +}
Assuming Grant's patch to make setup_arch optional gets applied, this
can go too.
> +
> +define_machine(kilauea) {
> + .name = "Kilauea",
> + .probe = kilauea_probe,
> + .setup_arch = kilauea_setup_arch,
> + .progress = udbg_progress,
> + .init_IRQ = uic_init_tree,
> + .get_irq = uic_get_irq,
> + .calibrate_decr = generic_calibrate_decr,
> +};
Other than those two comments, looks good.
josh
^ permalink raw reply
* Re: [PATCH 3/3] [POWERPC] Kilauea DTS
From: Josh Boyer @ 2007-10-10 20:21 UTC (permalink / raw)
To: Stefan Roese; +Cc: linuxppc-dev
In-Reply-To: <200710081110.16447.sr@denx.de>
On Mon, 2007-10-08 at 11:10 +0200, Stefan Roese wrote:
> Signed-off-by: Stefan Roese <sr@denx.de>
Looks pretty good. Just a couple of questions.
> ---
> arch/powerpc/boot/dts/kilauea.dts | 253 +++++++++++++++++++++++++++++++++++++
> 1 files changed, 253 insertions(+), 0 deletions(-)
> create mode 100644 arch/powerpc/boot/dts/kilauea.dts
>
> diff --git a/arch/powerpc/boot/dts/kilauea.dts b/arch/powerpc/boot/dts/kilauea.dts
> new file mode 100644
> index 0000000..4683174
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/kilauea.dts
> @@ -0,0 +1,253 @@
> +/*
> + * Device Tree Source for AMCC Kilauea (405EX)
> + *
> + * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de>
> + *
> + * This file is licensed under the terms of the GNU General Public
> + * License version 2. This program is licensed "as is" without
> + * any warranty of any kind, whether express or implied.
> + */
> +
> +/ {
> + #address-cells = <1>;
> + #size-cells = <1>;
> + model = "amcc,kilauea";
> + compatible = "amcc,kilauea";
> + dcr-parent = <&/cpus/PowerPC,405EX@0>;
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + PowerPC,405EX@0 {
> + device_type = "cpu";
> + reg = <0>;
> + clock-frequency = <0>; /* Filled in by U-Boot */
Filled in by U-Boot itself? Or by a cuboot wrapper? (which I can't find
in the patches.)
> + timebase-frequency = <0>; /* Filled in by U-Boot */
> + i-cache-line-size = <20>;
> + d-cache-line-size = <20>;
> + i-cache-size = <4000>; /* 16 kB */
> + d-cache-size = <4000>; /* 16 kB */
> + dcr-controller;
> + dcr-access-method = "native";
> + };
> + };
> +
> + memory {
> + device_type = "memory";
> + reg = <0 0>; /* Filled in by U-Boot */
> + };
> +
> + UIC0: interrupt-controller {
> + compatible = "ibm,uic-405ex", "ibm,uic";
> + interrupt-controller;
> + cell-index = <0>;
> + dcr-reg = <0c0 009>;
> + #address-cells = <0>;
> + #size-cells = <0>;
> + #interrupt-cells = <2>;
> + };
> +
> + UIC1: interrupt-controller1 {
> + compatible = "ibm,uic-405ex","ibm,uic";
> + interrupt-controller;
> + cell-index = <1>;
> + dcr-reg = <0d0 009>;
> + #address-cells = <0>;
> + #size-cells = <0>;
> + #interrupt-cells = <2>;
> + interrupts = <1e 4 1f 4>; /* cascade */
> + interrupt-parent = <&UIC0>;
> + };
> +
> + UIC2: interrupt-controller2 {
> + compatible = "ibm,uic-405ex","ibm,uic";
> + interrupt-controller;
> + cell-index = <2>;
> + dcr-reg = <0e0 009>;
> + #address-cells = <0>;
> + #size-cells = <0>;
> + #interrupt-cells = <2>;
> + interrupts = <1c 4 1d 4>; /* cascade */
> + interrupt-parent = <&UIC0>;
> + };
> +
> + plb {
> + compatible = "ibm,plb-405ex", "ibm,plb4";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges;
> + clock-frequency = <0>; /* Filled in by U-Boot */
> +
> + SDRAM0: memory-controller {
> + compatible = "ibm,sdram-405ex";
> + dcr-reg = <010 2>;
> + };
> +
> + MAL0: mcmal {
> + compatible = "ibm,mcmal-405ex", "ibm,mcmal2";
> + dcr-reg = <180 62>;
> + num-tx-chans = <2>;
> + num-rx-chans = <2>;
> + interrupt-parent = <&MAL0>;
> + interrupts = <0 1 2 3 4>;
> + #interrupt-cells = <1>;
> + #address-cells = <0>;
> + #size-cells = <0>;
> + interrupt-map = </*TXEOB*/ 0 &UIC0 a 4
> + /*RXEOB*/ 1 &UIC0 b 4
> + /*SERR*/ 2 &UIC1 0 4
> + /*TXDE*/ 3 &UIC1 1 4
> + /*RXDE*/ 4 &UIC1 2 4>;
> + interrupt-map-mask = <ffffffff>;
> + };
> +
> + POB0: opb {
> + compatible = "ibm,opb-405ex", "ibm,opb";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <ef600000 ef600000 a00000>;
> + dcr-reg = <0a0 5>;
> + clock-frequency = <0>; /* Filled in by U-Boot */
> +
> + EBC0: ebc {
> + compatible = "ibm,ebc-405ex", "ibm,ebc";
> + dcr-reg = <012 2>;
> + #address-cells = <2>;
> + #size-cells = <1>;
> + clock-frequency = <0>; /* Filled in by U-Boot */
> + interrupts = <5 1>;
This interrupt is really rising edge? Just double checking.
> + interrupt-parent = <&UIC1>;
> +
> + nor_flash@0,0 {
You have no ranges property for the ebc parent node. Is if filled in by
U-Boot? If so, please add a comment because otherwise I don't see how
this mapping will work.
> + compatible = "amd,s29gl256n", "cfi-flash";
> + bank-width = <2>;
> + reg = <0 000000 4000000>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> + partition@0 {
> + label = "Kernel";
> + reg = <0 180000>;
> + };
> + partition@180000 {
> + label = "ramdisk";
> + reg = <180000 200000>;
> + };
> + partition@380000 {
> + label = "file system";
> + reg = <380000 3aa0000>;
> + };
> + partition@3e20000 {
> + label = "kozio";
> + reg = <3e20000 140000>;
> + };
> + partition@3f60000 {
> + label = "env";
> + reg = <3f60000 40000>;
> + };
> + partition@3fa0000 {
> + label = "u-boot";
> + reg = <3fa0000 60000>;
> + };
> + };
> + };
> +
> + UART0: serial@ef600200 {
> + device_type = "serial";
> + compatible = "ns16550";
> + reg = <ef600200 8>;
> + virtual-reg = <ef600200>;
> + clock-frequency = <0>; /* Filled in by U-Boot */
> + current-speed = <0>;
> + interrupt-parent = <&UIC0>;
> + interrupts = <1a 4>;
> + };
> +
> + UART1: serial@ef600300 {
> + device_type = "serial";
> + compatible = "ns16550";
> + reg = <ef600300 8>;
> + virtual-reg = <ef600300>;
> + clock-frequency = <0>; /* Filled in by U-Boot */
> + current-speed = <0>;
> + interrupt-parent = <&UIC0>;
> + interrupts = <1 4>;
> + };
> +
> + IIC0: i2c@ef600400 {
> + device_type = "i2c";
> + compatible = "ibm,iic-405ex", "ibm,iic";
> + reg = <ef600400 14>;
> + interrupt-parent = <&UIC0>;
> + interrupts = <2 4>;
> + };
> +
> + IIC1: i2c@ef600500 {
> + device_type = "i2c";
> + compatible = "ibm,iic-405ex", "ibm,iic";
> + reg = <ef600500 14>;
> + interrupt-parent = <&UIC0>;
> + interrupts = <7 4>;
> + };
> +
> +
> + RGMII0: emac-rgmii@ef600b00 {
> + device_type = "rgmii-interface";
> + compatible = "ibm,rgmii-405ex", "ibm,rgmii";
> + reg = <ef600b00 104>;
> + };
> +
> + EMAC0: ethernet@ef600900 {
> + linux,network-index = <0>;
> + device_type = "network";
> + compatible = "ibm,emac-405ex", "ibm,emac4";
> + interrupt-parent = <&EMAC0>;
> + interrupts = <0 1>;
> + #interrupt-cells = <1>;
> + #address-cells = <0>;
> + #size-cells = <0>;
> + interrupt-map = </*Status*/ 0 &UIC0 18 4
> + /*Wake*/ 1 &UIC1 1d 4>;
> + reg = <ef600900 70>;
> + local-mac-address = [000000000000];
Does U-Boot (or the wrapper) poke these values as well?
> + mal-device = <&MAL0>;
> + mal-tx-channel = <0>;
> + mal-rx-channel = <0>;
> + cell-index = <0>;
> + max-frame-size = <5dc>;
> + rx-fifo-size = <1000>;
> + tx-fifo-size = <800>;
> + phy-mode = "rgmii";
> + phy-map = <00000000>;
> + rgmii-device = <&RGMII0>;
> + rgmii-channel = <0>;
> + };
> +
> + EMAC1: ethernet@ef600a00 {
> + linux,network-index = <1>;
> + device_type = "network";
> + compatible = "ibm,emac-405ex", "ibm,emac4";
> + interrupt-parent = <&EMAC1>;
> + interrupts = <0 1>;
> + #interrupt-cells = <1>;
> + #address-cells = <0>;
> + #size-cells = <0>;
> + interrupt-map = </*Status*/ 0 &UIC0 19 4
> + /*Wake*/ 1 &UIC1 1f 4>;
> + reg = <ef600a00 70>;
> + local-mac-address = [000000000000];
> + mal-device = <&MAL0>;
> + mal-tx-channel = <1>;
> + mal-rx-channel = <1>;
> + cell-index = <1>;
> + max-frame-size = <5dc>;
> + rx-fifo-size = <1000>;
> + tx-fifo-size = <800>;
> + phy-mode = "rgmii";
> + phy-map = <00000000>;
> + rgmii-device = <&RGMII0>;
> + rgmii-channel = <1>;
> + };
> + };
> + };
No chosen node?
josh
^ permalink raw reply
* Re: [PATCH] Bootwrapper: Enable debug info on boot wrapper
From: Scott Wood @ 2007-10-10 20:10 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, david
In-Reply-To: <fa686aa40710101256q3783994dr854e2bdecddf9820@mail.gmail.com>
Grant Likely wrote:
> Any comments on this one? Scott? David?
It's fine with me.
-Scott
^ permalink raw reply
* Re: [PATCH] Bootwrapper: Enable debug info on boot wrapper
From: Grant Likely @ 2007-10-10 19:56 UTC (permalink / raw)
To: linuxppc-dev, david, paulus, Scott Wood
In-Reply-To: <20071004040501.16923.68468.stgit@trillian.cg.shawcable.net>
Any comments on this one? Scott? David?
Cheers,
g.
On 10/3/07, Grant Likely <grant.likely@secretlab.ca> wrote:
> From: Grant Likely <grant.likely@secretlab.ca>
>
> Add '-g' to BOOTCFLAGS if CONFIG_DEBUG_INFO is set.
>
> Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
> ---
>
> arch/powerpc/boot/Makefile | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile
> index cf80db3..9dfe79b 100644
> --- a/arch/powerpc/boot/Makefile
> +++ b/arch/powerpc/boot/Makefile
> @@ -25,6 +25,10 @@ BOOTCFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
> -isystem $(shell $(CROSS32CC) -print-file-name=include)
> BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc
>
> +ifdef CONFIG_DEBUG_INFO
> +BOOTCFLAGS += -g
> +endif
> +
> ifeq ($(call cc-option-yn, -fstack-protector),y)
> BOOTCFLAGS += -fno-stack-protector
> endif
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* Re: [PATCH 2/3] [POWERPC] Add AMCC Kilauea eval board support to platforms/40x
From: Josh Boyer @ 2007-10-10 19:44 UTC (permalink / raw)
To: Stefan Roese; +Cc: Olof Johansson, linuxppc-dev
In-Reply-To: <200710091334.16682.sr@denx.de>
On Tue, 2007-10-09 at 13:34 +0200, Stefan Roese wrote:
> Hi Olof,
>
> On Monday 08 October 2007, Olof Johansson wrote:
> > > +config KILAUEA
> > > + bool "Kilauea"
> > > + depends on 40x
> > > + default y
> > > + select 405EX
> > > + help
> > > + This option enables support for the AMCC PPC405EX evaluation board.
> > > +
> > > #config REDWOOD_5
> > > # bool "Redwood-5"
> > > # depends on 40x
> > > @@ -89,14 +97,17 @@ config 403GCX
> > > #depends on OAK
> > > select IBM405_ERR51
> > >
> > > +config 405EP
> > > + bool
> > > +
> > > +config 405EX
> > > + bool
> > > +
> >
> > Do you really need config options for 405EP/EX? I don't seem them used
> > anywhere else in the code (and it's also contradictory to the whole new
> > multiplatform way of looking at stuff :).
> >
> > I know the 405/440 is still somewhat #ifdef:ed on the cpu here and there,
> > but since this doesn't add any such code I don't see a need for the config
> > options?
>
> Yes, I'm still used to needing these defines from arch/ppc (for example for
> the 4xx EMAC driver). But its possible, that we really don't need it at all
> in arch/powerpc with all the device tree information. Not sure though.
>
> Josh, what do you think? Should I remove the 405EX define completely?
If it's not needed, it can go. As Olof said, it doesn't appear to be
used anywhere in the code so I think it's fine.
One question I do have is if 405EX and 405EP need any of the 405GP
errata config options selected. I would like to think those don't apply
because the hardware is fixed, but I haven't checked to be sure.
josh
^ permalink raw reply
* [PATCH 3/3] Platforms shouldn't mess with ROOT_DEV
From: Grant Likely @ 2007-10-10 18:48 UTC (permalink / raw)
To: paulus, linuxppc-dev, galak, arnd, linas, benh, geoffrey.levand
In-Reply-To: <20071010184542.13609.70984.stgit@trillian.cg.shawcable.net>
From: Grant Likely <grant.likely@secretlab.ca>
There is no good reason for board platform code to mess with the ROOT_DEV.
Remove it from all in-tree platforms except powermac
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/platforms/52xx/efika.c | 9 ---------
arch/powerpc/platforms/52xx/lite5200.c | 12 ------------
arch/powerpc/platforms/cell/setup.c | 5 -----
arch/powerpc/platforms/celleb/setup.c | 5 -----
arch/powerpc/platforms/chrp/setup.c | 10 ----------
arch/powerpc/platforms/pseries/setup.c | 5 -----
6 files changed, 0 insertions(+), 46 deletions(-)
diff --git a/arch/powerpc/platforms/52xx/efika.c b/arch/powerpc/platforms/52xx/efika.c
index 6fc17fa..a0da70c 100644
--- a/arch/powerpc/platforms/52xx/efika.c
+++ b/arch/powerpc/platforms/52xx/efika.c
@@ -180,15 +180,6 @@ static void __init efika_setup_arch(void)
{
rtas_initialize();
-#ifdef CONFIG_BLK_DEV_INITRD
- initrd_below_start_ok = 1;
-
- if (initrd_start)
- ROOT_DEV = Root_RAM0;
- else
-#endif
- ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
-
efika_pcisetup();
#ifdef CONFIG_PM
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 0caa3d9..a0b4934 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -156,18 +156,6 @@ static void __init lite5200_setup_arch(void)
of_node_put(np);
}
#endif
-
-#ifdef CONFIG_BLK_DEV_INITRD
- if (initrd_start)
- ROOT_DEV = Root_RAM0;
- else
-#endif
-#ifdef CONFIG_ROOT_NFS
- ROOT_DEV = Root_NFS;
-#else
- ROOT_DEV = Root_HDA1;
-#endif
-
}
/*
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index db66542..3d679b1 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -161,11 +161,6 @@ static void __init cell_setup_arch(void)
/* init to some ~sane value until calibrate_delay() runs */
loops_per_jiffy = 50000000;
- if (ROOT_DEV == 0) {
- printk("No ramdisk, default root is /dev/hda2\n");
- ROOT_DEV = Root_HDA2;
- }
-
/* Find and initialize PCI host bridges */
init_pci_config_tokens();
find_and_init_phbs();
diff --git a/arch/powerpc/platforms/celleb/setup.c b/arch/powerpc/platforms/celleb/setup.c
index 0f1dddb..1769d75 100644
--- a/arch/powerpc/platforms/celleb/setup.c
+++ b/arch/powerpc/platforms/celleb/setup.c
@@ -101,11 +101,6 @@ static void __init celleb_setup_arch(void)
/* init to some ~sane value until calibrate_delay() runs */
loops_per_jiffy = 50000000;
- if (ROOT_DEV == 0) {
- printk("No ramdisk, default root is /dev/hda2\n");
- ROOT_DEV = Root_HDA2;
- }
-
#ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con;
#endif
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c
index 96498ad..5930626 100644
--- a/arch/powerpc/platforms/chrp/setup.c
+++ b/arch/powerpc/platforms/chrp/setup.c
@@ -290,16 +290,6 @@ void __init chrp_setup_arch(void)
ppc_md.set_rtc_time = rtas_set_rtc_time;
}
-#ifdef CONFIG_BLK_DEV_INITRD
- /* this is fine for chrp */
- initrd_below_start_ok = 1;
-
- if (initrd_start)
- ROOT_DEV = Root_RAM0;
- else
-#endif
- ROOT_DEV = Root_SDA2; /* sda2 (sda1 is for the kernel) */
-
/* On pegasos, enable the L2 cache if not already done by OF */
pegasos_set_l2cr();
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
index f0b7146..fdb9b1c 100644
--- a/arch/powerpc/platforms/pseries/setup.c
+++ b/arch/powerpc/platforms/pseries/setup.c
@@ -257,11 +257,6 @@ static void __init pSeries_setup_arch(void)
/* init to some ~sane value until calibrate_delay() runs */
loops_per_jiffy = 50000000;
- if (ROOT_DEV == 0) {
- printk("No ramdisk, default root is /dev/sda2\n");
- ROOT_DEV = Root_SDA2;
- }
-
fwnmi_init();
/* Find and initialize PCI host bridges */
^ permalink raw reply related
* [PATCH 1/3] Only call ppc_md.setup_arch() if it is provided.
From: Grant Likely @ 2007-10-10 18:48 UTC (permalink / raw)
To: paulus, linuxppc-dev, galak, arnd, linas, benh, geoffrey.levand
In-Reply-To: <20071010184542.13609.70984.stgit@trillian.cg.shawcable.net>
From: Grant Likely <grant.likely@secretlab.ca>
This allows platforms which don't have anything to do at setup_arch time
(like a bunch of the 4xx platforms) to eliminate an empty setup_arch hook.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
arch/powerpc/kernel/setup_32.c | 3 ++-
arch/powerpc/kernel/setup_64.c | 3 ++-
include/asm-powerpc/machdep.h | 2 +-
3 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c
index 7474502..cd870a8 100644
--- a/arch/powerpc/kernel/setup_32.c
+++ b/arch/powerpc/kernel/setup_32.c
@@ -290,7 +290,8 @@ void __init setup_arch(char **cmdline_p)
conswitchp = &dummy_con;
#endif
- ppc_md.setup_arch();
+ if (ppc_md.setup_arch)
+ ppc_md.setup_arch();
if ( ppc_md.progress ) ppc_md.progress("arch: exit", 0x3eab);
paging_init();
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 3089eae..008ab68 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -530,7 +530,8 @@ void __init setup_arch(char **cmdline_p)
conswitchp = &dummy_con;
#endif
- ppc_md.setup_arch();
+ if (ppc_md.setup_arch)
+ ppc_md.setup_arch();
paging_init();
ppc64_boot_msg(0x15, "Setup Done");
diff --git a/include/asm-powerpc/machdep.h b/include/asm-powerpc/machdep.h
index 71c6e7e..cc7c17f 100644
--- a/include/asm-powerpc/machdep.h
+++ b/include/asm-powerpc/machdep.h
@@ -99,7 +99,7 @@ struct machdep_calls {
#endif /* CONFIG_PPC64 */
int (*probe)(void);
- void (*setup_arch)(void);
+ void (*setup_arch)(void); /* Optional, may be NULL */
void (*init_early)(void);
/* Optional, may be NULL. */
void (*show_cpuinfo)(struct seq_file *m);
^ permalink raw reply related
* [PATCH 0/3] Miscellaneous powerpc patches
From: Grant Likely @ 2007-10-10 18:48 UTC (permalink / raw)
To: paulus, linuxppc-dev, galak, arnd, linas, benh, geoffrey.levand
Paulus,
Here are some patches that have been received favorably on the mailing
list. However, they aren't specific to one particular platform, so Kumar
suggested that they should probably go straight to your tree.
If they look okay to you, can you please pick them up?
Thanks,
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox