* Re: crash on shutdown on rs/6000 powerpc
From: Milton Miller @ 2007-10-10 16:18 UTC (permalink / raw)
To: Joel Schopp; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <470CF38F.3080809%40austin.ibm.com>
Joel Schoopp wrote:
>Paulus wrote:
>> [c00000003f923c40] c00000000003bff4 .xics_migrate_irqs_away+0x3c/0x20c
>> [c00000003f923d00] c000000000040d54 .pseries_cpu_disable+0x98/0xb4
>> [c00000003f923d80] c000000000028e4c .__cpu_disable+0x44/0x58
>> [c00000003f923df0] c00000000007e204 .take_cpu_down+0x34/0x60
>> [c00000003f923e70] c00000000008ba3c .do_stop+0x144/0x1e4
>> [c00000003f923f00] c00000000006fd74 .kthread+0x78/0xc4
>> [c00000003f923f90] c0000000000272a8 .kernel_thread+0x4c
>>
>> I don't have time tonight or tomorrow to track this down further. I'm
>> taking the kids to the coast tommorow. :)
>>
> This looks like the problem Olof and Milton sent out patches to fix. The
> Power3 shouldn't be doing cpu hotplug.
Paul's comment prompted both of us.
Actually, cpu_hotplug (offline calling rtas stop-self, not dlpar
remove) should be supported on POWER3 and RS64, its just that the
pseries disable code calls over into xics directly. offline support
would help preserve system uptime under a "failing processor"
scenerio.
To fix that, we need a mpic version of migrate_irqs_away. powermac
is using the "bury head in sand" approach for that right now (ie
if you bind an interrupt and offline all the cpus in the mask, the
interrupt won't be delivered until you reset the affinity). Its also
a broken in that bringing a cpu back online adds the cpu to all
interrupts not just those who have the cpu mask bit set.
milton
^ permalink raw reply
* Marvell 88se6121 in Kernel2.4
From: mike zheng @ 2007-10-10 16:29 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 109 bytes --]
Hello,
Anyone has the source code of kernel2.4 device driver for Marvel 88se6121?
Thanks in advance,
Mike
[-- Attachment #2: Type: text/html, Size: 205 bytes --]
^ permalink raw reply
* Please pull linux-2.6-mpc52xx.git
From: Grant Likely @ 2007-10-10 16:30 UTC (permalink / raw)
To: Paul Mackerras, linuxppc-dev, Sylvain Munaut
Paulus,
Sylvain has asked if I would like to help with the mpc52xx
maintainership. If it's okay by you, here is a patch that adds me as
co-maintainer for the mpc52xx platform along with 3 other mpc52xx
related fixes.
Sylvain, can you please reply to this message confirming that this is
what we talked about?
Thanks,
g.
The following changes since commit dcccb37e98e0444b0c6a03b303855771aa463c96:
Grant Likely (1):
[POWERPC] Lite5200: Use comma delimiter format for lists in device tree
are available in the git repository at:
git://git.secretlab.ca/git/linux-2.6-mpc52xx.git for-2.6.24
Grant Likely (4):
[POWERPC] MPC52xx: Drop show_cpuinfo platform hooks from Lite5200
[POWERPC] MPC52xx: Trim includes on mpc5200 platform support code
[POWERPC] MPC5200: Don't make firmware fixups into common code
[POWERPC] Add co-maintainer for PowerPC MPC52xx platform
MAINTAINERS | 2 +
arch/powerpc/platforms/52xx/efika.c | 19 +-----
arch/powerpc/platforms/52xx/lite5200.c | 95 ++++++++++++++------------
arch/powerpc/platforms/52xx/mpc52xx_common.c | 38 ++++-------
arch/powerpc/platforms/52xx/mpc52xx_pic.c | 11 +---
include/asm-powerpc/mpc52xx.h | 2 +-
6 files changed, 68 insertions(+), 99 deletions(-)
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply
* Re: [PATCH v2] powerpc: don't enable cpu hotplug on mpic-based pseries
From: Olof Johansson @ 2007-10-10 16:43 UTC (permalink / raw)
To: Milton Miller
Cc: Stephen Rothwell, Greg Kroah-Hartman, linux-kernel, linuxppc-dev,
Paul Mackerras, Linus Torvalds
In-Reply-To: <200710101008.l9AA8hIG084068@sullivan.realtime.net>
On Wed, Oct 10, 2007 at 05:08:44AM -0500, Milton Miller wrote:
> Olof's patch searched the device-tree again, looking for an mpic. This
> code instead checks that we found an xics the first time by checking the
> init function.
I'm glad you find the kernel so perfect that your best use of time is
to tweak the code added in a non-critical path (performance-wise) with
a new way of checking for hardware features (no other code in the kernel
checks ppc_md function pointers for that purpose).
Pseries can only have mpic or xics, so it's not like it matters if we
check for mpic or !xics, either.
But hey, any color bike shed will do, and I don't care which one Paul
chooses to merge. I will not waste more time debating this simple patch
though. :)
-Olof
^ permalink raw reply
* Re: include/asm/cpm2.h:14:21: error: asm/cpm.h: No such file or directory
From: Scott Wood @ 2007-10-10 16:39 UTC (permalink / raw)
To: Misbah khan; +Cc: linuxppc-dev
In-Reply-To: <13129025.post@talk.nabble.com>
On Tue, Oct 09, 2007 at 09:03:13PM -0700, Misbah khan wrote:
>
> Please Let me know the Status
>
> Misbah
Are you suddenly Timur's boss? :-)
The issue was a misapplied patch in Kumar's tree. It has been fixed, as he
pointed out in another post in this thread.
-Scott
^ permalink raw reply
* Re: [PATCH] Device tree bindings for Xilinx devices
From: Grant Likely @ 2007-10-10 16:39 UTC (permalink / raw)
To: linuxppc-dev, Segher Boessenkool, Josh Boyer, David Gibson
In-Reply-To: <20071008075127.9887.38702.stgit@trillian.cg.shawcable.net>
Anybody have any comments on this? Segher? David?
Cheers,
g.
On 10/8/07, Grant Likely <grant.likely@secretlab.ca> 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.
>
> 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"
> + - 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.
> + - 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"
> + - 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.
> +
> VII - Specifying interrupt information for devices
> ===================================================
>
>
> _______________________________________________
> 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
* [PATCH 2/3] Xilinxfb: Add support for custom screen resolution
From: Grant Likely @ 2007-10-10 18:31 UTC (permalink / raw)
To: linux-fbdev-devel, akonovalov, linuxppc-dev, adaplas, jwboyer
In-Reply-To: <20071010182920.12852.41903.stgit@trillian.cg.shawcable.net>
From: Grant Likely <grant.likely@secretlab.ca>
Some custom implementations of the xilinx fb can use resolutions other
than 640x480. This patch allows the resolution to be specified in the
device tree or the xilinx_platform_data structure.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
drivers/video/xilinxfb.c | 71 +++++++++++++++++++++++++++++-----------------
include/linux/xilinxfb.h | 6 +++-
2 files changed, 49 insertions(+), 28 deletions(-)
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index b3b57f4..c617412 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -70,12 +70,6 @@
*/
#define BYTES_PER_PIXEL 4
#define BITS_PER_PIXEL (BYTES_PER_PIXEL * 8)
-#define XRES 640
-#define YRES 480
-#define XRES_VIRTUAL 1024
-#define YRES_VIRTUAL YRES
-#define LINE_LENGTH (XRES_VIRTUAL * BYTES_PER_PIXEL)
-#define FB_SIZE (YRES_VIRTUAL * LINE_LENGTH)
#define RED_SHIFT 16
#define GREEN_SHIFT 8
@@ -87,6 +81,10 @@
* Default xilinxfb configuration
*/
static struct xilinxfb_platform_data xilinx_fb_default_pdata = {
+ .xres = 640,
+ .yres = 480,
+ .xvirt = 1024,
+ .yvirt = 480;
};
/*
@@ -96,17 +94,10 @@ static struct fb_fix_screeninfo xilinx_fb_fix = {
.id = "Xilinx",
.type = FB_TYPE_PACKED_PIXELS,
.visual = FB_VISUAL_TRUECOLOR,
- .smem_len = FB_SIZE,
- .line_length = LINE_LENGTH,
.accel = FB_ACCEL_NONE
};
static struct fb_var_screeninfo xilinx_fb_var = {
- .xres = XRES,
- .yres = YRES,
- .xres_virtual = XRES_VIRTUAL,
- .yres_virtual = YRES_VIRTUAL,
-
.bits_per_pixel = BITS_PER_PIXEL,
.red = { RED_SHIFT, 8, 0 },
@@ -217,6 +208,7 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
{
struct xilinxfb_drvdata *drvdata;
int rc;
+ int fbsize = pdata->xvirt * pdata->yvirt * BYTES_PER_PIXEL;
/* Allocate the driver data region */
drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
@@ -243,7 +235,7 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
}
/* Allocate the framebuffer memory */
- drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(FB_SIZE),
+ drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
&drvdata->fb_phys, GFP_KERNEL);
if (!drvdata->fb_virt) {
dev_err(dev, "Could not allocate frame buffer memory\n");
@@ -252,7 +244,7 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
}
/* Clear (turn to black) the framebuffer */
- memset_io((void __iomem *)drvdata->fb_virt, 0, FB_SIZE);
+ memset_io((void __iomem *)drvdata->fb_virt, 0, fbsize);
/* Tell the hardware where the frame buffer is */
xilinx_fb_out_be32(drvdata, REG_FB_ADDR, drvdata->fb_phys);
@@ -269,12 +261,18 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
drvdata->info.fbops = &xilinxfb_ops;
drvdata->info.fix = xilinx_fb_fix;
drvdata->info.fix.smem_start = drvdata->fb_phys;
+ drvdata->info.fix.smem_len = fbsize;
+ drvdata->info.fix.line_length = pdata->xvirt * BYTES_PER_PIXEL;
+
drvdata->info.pseudo_palette = drvdata->pseudo_palette;
drvdata->info.flags = FBINFO_DEFAULT;
drvdata->info.var = xilinx_fb_var;
-
- xilinx_fb_var.height = pdata->screen_height_mm;
- xilinx_fb_var.width = pdata->screen_width_mm;
+ drvdata->info.var.height = pdata->screen_height_mm;
+ drvdata->info.var.width = pdata->screen_width_mm;
+ drvdata->info.var.xres = pdata->xres;
+ drvdata->info.var.yres = pdata->yres;
+ drvdata->info.var.xres_virtual = pdata->xvirt;
+ drvdata->info.var.yres_virtual = pdata->yvirt;
/* Allocate a colour map */
rc = fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0);
@@ -294,14 +292,15 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
/* Put a banner in the log (for DEBUG) */
dev_dbg(dev, "regs: phys=%lx, virt=%p\n", physaddr, drvdata->regs);
dev_dbg(dev, "fb: phys=%p, virt=%p, size=%x\n",
- (void*)drvdata->fb_phys, drvdata->fb_virt, FB_SIZE);
+ (void*)drvdata->fb_phys, drvdata->fb_virt, fbsize);
+
return 0; /* success */
err_regfb:
fb_dealloc_cmap(&drvdata->info.cmap);
err_cmap:
- dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt,
+ dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt,
drvdata->fb_phys);
/* Turn off the display */
xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
@@ -331,8 +330,8 @@ static int xilinxfb_release(struct device *dev)
fb_dealloc_cmap(&drvdata->info.cmap);
- dma_free_coherent(dev, PAGE_ALIGN(FB_SIZE), drvdata->fb_virt,
- drvdata->fb_phys);
+ dma_free_coherent(dev, PAGE_ALIGN(drvdata->info.fix.smem_len),
+ drvdata->fb_virt, drvdata->fb_phys);
/* Turn off the display */
xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
@@ -364,10 +363,18 @@ xilinxfb_platform_probe(struct platform_device *pdev)
}
/* If a pdata structure is provided, then extract the parameters */
- if (pdev->dev.platform_data)
+ pdata = &xilinx_fb_default_pdata;
+ if (pdev->dev.platform_data) {
pdata = pdev->dev.platform_data;
- else
- pdata = &xilinx_fb_default_pdata;
+ if (!pdata->xres)
+ pdata->xres = xilinx_fb_default_pdata.xres;
+ if (!pdata->yres)
+ pdata->yres = xilinx_fb_default_pdata.yres;
+ if (!pdata->xvirt)
+ pdata->xvirt = xilinx_fb_default_pdata.xvirt;
+ if (!pdata->yvirt)
+ pdata->yvirt = xilinx_fb_default_pdata.yvirt;
+ }
return xilinxfb_assign(&pdev->dev, res->start, pdata);
}
@@ -412,12 +419,24 @@ xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match)
return rc;
}
- prop = of_get_property(op->node, "display-number", &size);
+ prop = of_get_property(op->node, "phys-size", &size);
if ((prop) && (size >= sizeof(u32)*2)) {
pdata.screen_width_mm = prop[0];
pdata.screen_height_mm = prop[1];
}
+ prop = of_get_property(op->node, "resolution", &size);
+ if ((prop) && (size >= sizeof(u32)*2)) {
+ pdata.xres = prop[0];
+ pdata.yres = prop[1];
+ }
+
+ prop = of_get_property(op->node, "virtual-resolution", &size);
+ if ((prop) && (size >= sizeof(u32)*2)) {
+ pdata.xvirt = prop[0];
+ pdata.yvirt = prop[1];
+ }
+
if (of_find_property(op->node, "rotate-display", NULL))
pdata.rotate_screen = 1;
diff --git a/include/linux/xilinxfb.h b/include/linux/xilinxfb.h
index 9ad984d..199a1ee 100644
--- a/include/linux/xilinxfb.h
+++ b/include/linux/xilinxfb.h
@@ -15,9 +15,11 @@
/* ML300/403 reference design framebuffer driver platform data struct */
struct xilinxfb_platform_data {
- u32 rotate_screen;
- u32 screen_height_mm;
+ u32 rotate_screen; /* Flag to rotate display 180 degrees */
+ u32 screen_height_mm; /* Physical dimentions of screen in mm */
u32 screen_width_mm;
+ u32 xres, yres; /* resolution of screen in pixels */
+ u32 xvirt, yvirt; /* resolution of memory buffer */
};
#endif /* __XILINXFB_H__ */
^ permalink raw reply related
* [PATCH 0/3] More XilinxFB changes
From: Grant Likely @ 2007-10-10 18:31 UTC (permalink / raw)
To: linux-fbdev-devel, akonovalov, linuxppc-dev, adaplas, jwboyer
Here are some more changes on the xilinxfb driver. These changes add the
ability to specify a custom resolution or framebuffer physical address.
Useful for FPGA designs which use a modified xilinxfb device.
Please review and comment.
Cheers,
g.
--
Grant Likely, B.Sc. P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply
* [PATCH 3/3] XilinxFB: Allow fixed framebuffer base address
From: Grant Likely @ 2007-10-10 18:31 UTC (permalink / raw)
To: linux-fbdev-devel, akonovalov, linuxppc-dev, adaplas, jwboyer
In-Reply-To: <20071010182920.12852.41903.stgit@trillian.cg.shawcable.net>
From: Grant Likely <grant.likely@secretlab.ca>
Allow a fixed framebuffer address to be assigned to the framebuffer device
instead of allocating the framebuffer from the consistent memory pool.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
drivers/video/xilinxfb.c | 22 ++++++++++++++++------
include/linux/xilinxfb.h | 5 +++++
2 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index c617412..6ef99b2 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -117,6 +117,7 @@ struct xilinxfb_drvdata {
void *fb_virt; /* virt. address of the frame buffer */
dma_addr_t fb_phys; /* phys. address of the frame buffer */
+ int fb_alloced; /* Flag, was the fb memory alloced? */
u32 reg_ctrl_default;
@@ -235,8 +236,15 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
}
/* Allocate the framebuffer memory */
- drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
- &drvdata->fb_phys, GFP_KERNEL);
+ if (pdata->fb_phys) {
+ drvdata->fb_phys = pdata->fb_phys;
+ drvdata->fb_virt = ioremap(pdata->fb_phys, fbsize);
+ } else {
+ drvdata->fb_alloced = 1;
+ drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize),
+ &drvdata->fb_phys, GFP_KERNEL);
+ }
+
if (!drvdata->fb_virt) {
dev_err(dev, "Could not allocate frame buffer memory\n");
rc = -ENOMEM;
@@ -300,8 +308,9 @@ err_regfb:
fb_dealloc_cmap(&drvdata->info.cmap);
err_cmap:
- dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt,
- drvdata->fb_phys);
+ if (drvdata->fb_alloced)
+ dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt,
+ drvdata->fb_phys);
/* Turn off the display */
xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
@@ -330,8 +339,9 @@ static int xilinxfb_release(struct device *dev)
fb_dealloc_cmap(&drvdata->info.cmap);
- dma_free_coherent(dev, PAGE_ALIGN(drvdata->info.fix.smem_len),
- drvdata->fb_virt, drvdata->fb_phys);
+ if (drvdata->fb_alloced)
+ dma_free_coherent(dev, PAGE_ALIGN(drvdata->info.fix.smem_len),
+ drvdata->fb_virt, drvdata->fb_phys);
/* Turn off the display */
xilinx_fb_out_be32(drvdata, REG_CTRL, 0);
diff --git a/include/linux/xilinxfb.h b/include/linux/xilinxfb.h
index 199a1ee..f2463f5 100644
--- a/include/linux/xilinxfb.h
+++ b/include/linux/xilinxfb.h
@@ -20,6 +20,11 @@ struct xilinxfb_platform_data {
u32 screen_width_mm;
u32 xres, yres; /* resolution of screen in pixels */
u32 xvirt, yvirt; /* resolution of memory buffer */
+
+ /* Physical address of framebuffer memory; If non-zero, driver
+ * will use provided memory address instead of allocating one from
+ * the consistent pool. */
+ u32 fb_phys;
};
#endif /* __XILINXFB_H__ */
^ permalink raw reply related
* [PATCH 1/3] XilinxFB: use pdata to pass around framebuffer parameters.
From: Grant Likely @ 2007-10-10 18:31 UTC (permalink / raw)
To: linux-fbdev-devel, akonovalov, linuxppc-dev, adaplas, jwboyer
In-Reply-To: <20071010182920.12852.41903.stgit@trillian.cg.shawcable.net>
From: Grant Likely <grant.likely@secretlab.ca>
The call to xilinxfb_assign is getting unwieldy when adding features
to the Xilinx framebuffer driver. Change xilinxfb_assign() to accept
a pointer to a xilinxfb_platform_data structure to prepare for adding
additition configuration options.
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
drivers/video/xilinxfb.c | 43 +++++++++++++++++++++++--------------------
1 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/drivers/video/xilinxfb.c b/drivers/video/xilinxfb.c
index dec602c..b3b57f4 100644
--- a/drivers/video/xilinxfb.c
+++ b/drivers/video/xilinxfb.c
@@ -84,6 +84,12 @@
#define PALETTE_ENTRIES_NO 16 /* passed to fb_alloc_cmap() */
/*
+ * Default xilinxfb configuration
+ */
+static struct xilinxfb_platform_data xilinx_fb_default_pdata = {
+};
+
+/*
* Here are the default fb_fix_screeninfo and fb_var_screeninfo structures
*/
static struct fb_fix_screeninfo xilinx_fb_fix = {
@@ -207,7 +213,7 @@ static struct fb_ops xilinxfb_ops =
*/
static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
- int width_mm, int height_mm, int rotate)
+ struct xilinxfb_platform_data *pdata)
{
struct xilinxfb_drvdata *drvdata;
int rc;
@@ -253,7 +259,7 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
/* Turn on the display */
drvdata->reg_ctrl_default = REG_CTRL_ENABLE;
- if (rotate)
+ if (pdata->rotate_screen)
drvdata->reg_ctrl_default |= REG_CTRL_ROTATE;
xilinx_fb_out_be32(drvdata, REG_CTRL, drvdata->reg_ctrl_default);
@@ -267,8 +273,8 @@ static int xilinxfb_assign(struct device *dev, unsigned long physaddr,
drvdata->info.flags = FBINFO_DEFAULT;
drvdata->info.var = xilinx_fb_var;
- xilinx_fb_var.height = height_mm;
- xilinx_fb_var.width = width_mm;
+ xilinx_fb_var.height = pdata->screen_height_mm;
+ xilinx_fb_var.width = pdata->screen_width_mm;
/* Allocate a colour map */
rc = fb_alloc_cmap(&drvdata->info.cmap, PALETTE_ENTRIES_NO, 0);
@@ -349,9 +355,6 @@ xilinxfb_platform_probe(struct platform_device *pdev)
{
struct xilinxfb_platform_data *pdata;
struct resource *res;
- int width_mm = 0;
- int height_mm = 0;
- int rotate = 0;
/* Find the registers address */
res = platform_get_resource(pdev, IORESOURCE_IO, 0);
@@ -361,15 +364,12 @@ xilinxfb_platform_probe(struct platform_device *pdev)
}
/* If a pdata structure is provided, then extract the parameters */
- pdata = pdev->dev.platform_data;
- if (pdata) {
- height_mm = pdata->screen_height_mm;
- width_mm = pdata->screen_width_mm;
- rotate = pdata->rotate_screen ? 1 : 0;
- }
+ if (pdev->dev.platform_data)
+ pdata = pdev->dev.platform_data;
+ else
+ pdata = &xilinx_fb_default_pdata;
- return xilinxfb_assign(&pdev->dev, res->start, width_mm, height_mm,
- rotate);
+ return xilinxfb_assign(&pdev->dev, res->start, pdata);
}
static int
@@ -398,9 +398,12 @@ xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match)
{
struct resource res;
const u32 *prop;
- int width = 0, height = 0, rotate = 0;
+ struct xilinxfb_platform_data pdata;
int size, rc;
+ /* Copy with the default pdata (not a ptr reference!) */
+ pdata = xilinx_fb_default_pdata;
+
dev_dbg(&op->dev, "xilinxfb_of_probe(%p, %p)\n", op, match);
rc = of_address_to_resource(op->node, 0, &res);
@@ -411,14 +414,14 @@ xilinxfb_of_probe(struct of_device *op, const struct of_device_id *match)
prop = of_get_property(op->node, "display-number", &size);
if ((prop) && (size >= sizeof(u32)*2)) {
- width = prop[0];
- height = prop[1];
+ pdata.screen_width_mm = prop[0];
+ pdata.screen_height_mm = prop[1];
}
if (of_find_property(op->node, "rotate-display", NULL))
- rotate = 1;
+ pdata.rotate_screen = 1;
- return xilinxfb_assign(&op->dev, res.start, width, height, rotate);
+ return xilinxfb_assign(&op->dev, res.start, &pdata);
}
static int __devexit xilinxfb_of_remove(struct of_device *op)
^ permalink raw reply related
* [PATCH 2/3] Remove empty ppc_md.setup_arch hooks.
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>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
---
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,
^ 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
* [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 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
* 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
* 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] 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 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 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 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] 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
* 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: 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
* [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
* [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
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