serial driver for MPC5554?

2010-04-16 Thread Németh Márton
Hi,

is there somebody working on the MPC5554 [1] serial port driver? I could
only find linux/drivers/serial/mpc52xx_uart.c but I'm not sure whether
this could work together with the eSCI on-chip hardware module which
can be found in MPC5554 [2].

References:
[1] Freescale MPC5554
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC5554

[2] MPC5553/MPC5554 Microcontroller Reference Manual
http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf

Regards,

Márton Németh
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Freescale MPC5554 device tree (was: cross-compiling Linux for PowerPC e200 core?)

2010-03-29 Thread Németh Márton
Hi,

Grant Likely wrote:
> 2010/3/13 Németh Márton :
[...]
>> +   };
>> +
>> +   e...@3fc {  // Enhanced Time Processing 
>> Unit
>> +   compatible = "fsl,mpc5554-etpu";
>> +   reg = <0x03fc 0x4000>;
>> +   interrupts = <67 1  // Global Exception
>> + 68 1  // A Channel 0
>> + 69 1  // A Channel 1
>> + 70 1  // A Channel 2
>> + 71 1  // A Channel 3
>> + 72 1  // A Channel 4
>> + 73 1  // A Channel 5
>> + 74 1  // A Channel 6
>> + 75 1  // A Channel 7
>> + 76 1  // A Channel 8
>> + 77 1  // A Channel 9
>> + 78 1  // A Channel 10
>> + 79 1  // A Channel 11
>> + 80 1  // A Channel 12
>> + 81 1  // A Channel 13
>> + 82 1  // A Channel 14
>> + 83 1  // A Channel 15
>> + 84 1  // A Channel 16
>> + 85 1  // A Channel 17
>> + 86 1  // A Channel 18
>> + 87 1  // A Channel 19
>> + 88 1  // A Channel 20
>> + 89 1  // A Channel 21
>> + 90 1  // A Channel 22
>> + 91 1  // A Channel 23
>> + 92 1  // A Channel 24
>> + 93 1  // A Channel 25
>> + 94 1  // A Channel 26
>> + 95 1  // A Channel 27
>> + 96 1  // A Channel 28
>> + 97 1  // A Channel 29
>> + 98 1  // A Channel 30
>> + 99 1  // A Channel 31
>> + 243 1 // B Channel 0
>> + 244 1 // B Channel 1
>> + 245 1 // B Channel 2
>> + 246 1 // B Channel 3
>> + 247 1 // B Channel 4
>> + 248 1 // B Channel 5
>> + 249 1 // B Channel 6
>> + 250 1 // B Channel 7
>> + 251 1 // B Channel 8
>> + 252 1 // B Channel 9
>> + 253 1 // B Channel 10
>> + 254 1 // B Channel 11
>> + 255 1 // B Channel 12
>> + 256 1 // B Channel 13
>> + 257 1 // B Channel 14
>> + 258 1 // B Channel 15
>> + 259 1 // B Channel 16
>> + 260 1 // B Channel 17
>> + 261 1 // B Channel 18
>> + 262 1 // B Channel 19
>> + 263 1 // B Channel 20
>> + 264 1 // B Channel 21
>> + 265 1 // B Channel 22
>> + 266 1 // B Channel 23
>> + 

Linux patches for XIP on MPC8xx?

2010-03-22 Thread Németh Márton
Hi Wolfgang,

I found your homepage at 
http://www.denx.de/wiki/bin/view/DULG/ConfigureLinuxForXIP back
from 2003. Was there any follow up of your patch for kernel 2.4.4?

Regards,

Márton Németh
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Freescale MPC5554 device tree (was: cross-compiling Linux for PowerPC e200 core?)

2010-03-22 Thread Németh Márton
Grant Likely wrote:
> 2010/3/22 Németh Márton :
>> Hi Grant,
>>
>> thanks for the comments, I solved some of the points you mentioned. I need 
>> some
>> more time to work on the others. In the meantime I send the intermediate 
>> version.
>>
>> Grant Likely wrote:
>>> 2010/3/13 Németh Márton :
>> [...]
>>>> +   mem...@4000 {
>>>> +   device_type = "memory";
>>>> +   reg = <0x4000 0x1>; // 32KiB internal SRAM
>>>> +   };
>>> Oh this is the small SRAM.  yeah, you should move this under the
>>> appropriate bridge node, remove the device_type property, and add a
>>> compatible property.  Memory nodes at the root like this are used to
>>> describe what is basically main memory (what Linux will execute out
>>> of).  You'll want a new memory node for the external ram hooked up to
>>> the 5554.
>> Yes, it is the small one (actually 64KiB, I corrected the comment also).
>> I added the external memory of the MPC5554DEMO evaluation board which has
>> a size of 512KiB.
> 
> Yikes.  Half a meg is tiny for running Linux.
> 
>> Would it be possible to program the uncompressed kernel to the FLASH so
>> it can run directly from there? I guess for the code and the constant 
>> sections
>> the FLASH could be a good place. Then cstart has to initialize the 
>> initialized
>> variables by copying data from FLASH to RAM and fill the BSS area with zero.
> 
> Hmmm.  I don't know if anyone has kernel execute in place (XIP)
> working on PowerPC.

I found some promising links for XIP on PowerPC:
 - XIP for PowerQUICC™I 8xx: 
http://www.denx.de/wiki/bin/view/DULG/ConfigureLinuxForXIP
 - XIP on Arctic III PowerPC board: 
http://simplemachines.it/xip/KernelXIP.html#head-3d70ff3a6d5599f6f98f1d4b4becc9271310967d

>> [...]
>>>> +   s...@3f89000 {   // System Integration Unit
>>>> +   compatible = "fsl,mpc5554-siu";
>>>> +   reg = <0x03f9 0x4000>;
>>>> +   interrupts = <45 1  // External 
>>>> Interrupt Overrun 0-15
>>>> + 46 1  // External 
>>>> Interrupt 0
>>>> + 47 1  // External 
>>>> Interrupt 1
>>>> + 48 1  // External 
>>>> Interrupt 2
>>>> + 49 1  // External 
>>>> Interrupt 3
>>>> + 50 1>;// External 
>>>> Interrupt 4-15
>>>> +   };
>>> This doesn't look quite right /me goes to look at the 5554
>>> reference manual
>>>
>>> Okay, so all the external IRQs go through the SIU then, even though
>>> the first 4 get passed straight through to the intc?  And I see that
>>> all the level/edge sensing and masking/acknowledging is done at the
>>> SIU level, not the intc level, correct?  So, what you effectively have
>>> is the SIU is *another* interrupt controller that is cascaded to the
>>> intc.  Therefore you need to add the following to this node:
>>>
>>> #interrupt-cells = <2>;   // cell1:extirq#, cell2:level/edge flags
>>> interrupt-controller;
>>>
>>> Also give the node a label so that nodes for external devices can
>>> reference it for hooking up external irqs by overriding the top-level
>>> interrupt-parent property.
>>>
>>> Also, it would appear that intc interrupts don't have any level/edge
>>> configuration associated with them.  They are either asserted, or they
>>> are not, correct?  At the moment you're specifying every intc
>>> interrupt with 2 cells, and the 2nd cell is always '1'.  I think you
>>> can change #interrupt-cells to <1> in the intc node and drop the '1'
>>> everywhere.
>>>
>>> When you write your intc driver, you'll also need to write the
>>> cascaded driver for the external IRQs.
>> I tried to solve this point but I'm not quite sure whether the SIU interrupt
>> numbers shall be kept on the s...@3f89000 node or not.
> 
> Yes, you'll want the irq numbers to remain in the siu node because
> those are the 'cascade' irqs that the siu raises when the external
> irqs are 

Re: Freescale MPC5554 device tree (was: cross-compiling Linux for PowerPC e200 core?)

2010-03-21 Thread Németh Márton
Hi Grant,

thanks for the comments, I solved some of the points you mentioned. I need some
more time to work on the others. In the meantime I send the intermediate 
version.

Grant Likely wrote:
> 2010/3/13 Németh Márton :
[...]
>> +   mem...@4000 {
>> +   device_type = "memory";
>> +   reg = <0x4000 0x1>; // 32KiB internal SRAM
>> +   };
> 
> Oh this is the small SRAM.  yeah, you should move this under the
> appropriate bridge node, remove the device_type property, and add a
> compatible property.  Memory nodes at the root like this are used to
> describe what is basically main memory (what Linux will execute out
> of).  You'll want a new memory node for the external ram hooked up to
> the 5554.

Yes, it is the small one (actually 64KiB, I corrected the comment also).
I added the external memory of the MPC5554DEMO evaluation board which has
a size of 512KiB.

Would it be possible to program the uncompressed kernel to the FLASH so
it can run directly from there? I guess for the code and the constant sections
the FLASH could be a good place. Then cstart has to initialize the initialized
variables by copying data from FLASH to RAM and fill the BSS area with zero.

[...]
>> +   s...@3f89000 {   // System Integration Unit
>> +   compatible = "fsl,mpc5554-siu";
>> +   reg = <0x03f9 0x4000>;
>> +   interrupts = <45 1  // External 
>> Interrupt Overrun 0-15
>> + 46 1  // External 
>> Interrupt 0
>> + 47 1  // External 
>> Interrupt 1
>> + 48 1  // External 
>> Interrupt 2
>> + 49 1  // External 
>> Interrupt 3
>> + 50 1>;// External 
>> Interrupt 4-15
>> +   };
> 
> This doesn't look quite right /me goes to look at the 5554
> reference manual
> 
> Okay, so all the external IRQs go through the SIU then, even though
> the first 4 get passed straight through to the intc?  And I see that
> all the level/edge sensing and masking/acknowledging is done at the
> SIU level, not the intc level, correct?  So, what you effectively have
> is the SIU is *another* interrupt controller that is cascaded to the
> intc.  Therefore you need to add the following to this node:
> 
> #interrupt-cells = <2>;   // cell1:extirq#, cell2:level/edge flags
> interrupt-controller;
> 
> Also give the node a label so that nodes for external devices can
> reference it for hooking up external irqs by overriding the top-level
> interrupt-parent property.
> 
> Also, it would appear that intc interrupts don't have any level/edge
> configuration associated with them.  They are either asserted, or they
> are not, correct?  At the moment you're specifying every intc
> interrupt with 2 cells, and the 2nd cell is always '1'.  I think you
> can change #interrupt-cells to <1> in the intc node and drop the '1'
> everywhere.
> 
> When you write your intc driver, you'll also need to write the
> cascaded driver for the external IRQs.

I tried to solve this point but I'm not quite sure whether the SIU interrupt
numbers shall be kept on the s...@3f89000 node or not.

>> +   em...@3fa { // Modular Timer System
>> +   compatible = "fsl,mpc5554-emios";
>> +   reg = <0x03fa 0x4000>;
>> +   interrupts = <51 1  // Channel 0
>> + 52 1  // Channel 1
>> + 53 1  // Channel 2
>> + 54 1  // Channel 3
>> + 55 1  // Channel 4
>> + 56 1  // Channel 5
>> + 57 1  // Channel 6
>> + 58 1  // Channel 7
>> + 59 1  // Channel 8
>> + 60 1  // Channel 9
>> + 61 1  // Channel 10
>> + 62 1  // Channel 11
>> + 63 1  // Channel 

Re: Freescale MPC5554 device tree (was: cross-compiling Linux for PowerPC e200 core?)

2010-03-17 Thread Németh Márton
Hi Grant, David and Segher,

is there any comments or suggestions about this MPC5554 device tree?

Regards,

Márton Németh

Németh Márton wrote:
> Hi,
> 
> here is a version with modified cpu node, xbar ranges and added interrupt 
> sources.
> Please send comments.
> 
> Regards,
> 
>   Márton Németh
> 
> ---
> From: Márton Németh 
> 
> Add device tree for Freescale MPC5554.
> 
> Signed-off-by: Márton Németh 
> ---
> diff -uprN linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 
> linux/arch/powerpc/boot/dts/mpc5554.dts
> --- linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts   1970-01-01 
> 01:00:00.0 +0100
> +++ linux/arch/powerpc/boot/dts/mpc5554.dts   2010-03-13 12:52:32.0 
> +0100
> @@ -0,0 +1,473 @@
> +/*
> + * Freescale MPC5554 Device Tree Source
> + *
> + * Based on MPC5553/5554 Microcontroller Reference Manual, Rev. 4.0, 04/2007
> + * http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf
> + *  - Block Diagram: page 1-3, Figure 1-1
> + *  - Memory Map: page 1-21, Table 1-2
> + *  - Interrupt Request Sources: page 10-16, Table 10-9
> + *
> + * Copyright 2010 Márton Németh
> + * Márton Németh 
> + *
> + * 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.
> + */
> +
> +/dts-v1/;
> +
> +/ {
> + model = "MPC5554";
> + compatible = "fsl,MPC5554EVB";  // Freescale MPC5554 Evaluation 
> Board
> + #address-cells = <1>;
> + #size-cells = <1>;
> + interrupt-parent = <&intc>;
> +
> + cpus {
> + #address-cells = <1>;
> + #size-cells = <0>;
> +
> + c...@0 {
> + device_type = "cpu";
> + compatible = "PowerPC,5554", "fsl,mpc5554-e200z6", 
> "fsl,powerpc-e200z6";
> + reg = <0>;
> + d-cache-line-size = <32>;
> + i-cache-line-size = <32>;
> + d-cache-size = <0x8000>;// L1, 32KiB
> + i-cache-size = <0x8000>;// L1, 32KiB
> + timebase-frequency = <0>;   // from bootloader
> + bus-frequency = <0>;// from bootloader
> + clock-frequency = <0>;  // from bootloader
> + };
> + };
> +
> + mem...@4000 {
> + device_type = "memory";
> + reg = <0x4000 0x1>; // 32KiB internal SRAM
> + };
> +
> + x...@fff04000 { // System Bus Crossbar Switch (XBAR)
> + compatible = "fsl,mpc5554-xbar";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + // The full memory range is covered by XBAR
> + ranges;
> + reg = <0xfff04000 0x4000>;
> +
> + fl...@0 {   // read-only FLASH
> + compatible = "fsl,mpc5554-flash";
> + reg = <0x 0x20>;// 2MiB internal FLASH
> + };
> +
> + bri...@c3f0 {
> + compatible = "fsl,mpc5554-pbridge-a";
> + #address-cells = <1>;
> + #size-cells = <1>;
> + ranges = <0 0xc000 0x2000>;
> + reg = <0xc3f0 0x4000>;
> +
> + fm...@3f8 { // Frequency Modulated PLL
> + compatible = "fsl,mpc5554-fmpll";
> + reg = <0x03f8 0x4000>;
> + interrupts = <43 1  // Loss of Clock
> +   44 1>;// Loss of Lock
> + };
> +
> + flashcon...@3f88000 {   // Flash Configuration
> + compatible = "fsl,mpc5554-flashconfig";
> + reg = <0x03f88000 0x4000>;
> + };
> +
> + s...@3f89000 {  // System Integration Unit
> + compatible = "fsl,mpc5554-siu";
> + reg = <0x03f9 0x4000>;
> + interrupts = <45 1  // External Interru

Re: Freescale MPC5554 device tree (was: cross-compiling Linux for PowerPC e200 core?)

2010-03-13 Thread Németh Márton
Hi,

here is a version with modified cpu node, xbar ranges and added interrupt 
sources.
Please send comments.

Regards,

Márton Németh

---
From: Márton Németh 

Add device tree for Freescale MPC5554.

Signed-off-by: Márton Németh 
---
diff -uprN linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 
linux/arch/powerpc/boot/dts/mpc5554.dts
--- linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 1970-01-01 
01:00:00.0 +0100
+++ linux/arch/powerpc/boot/dts/mpc5554.dts 2010-03-13 12:52:32.0 
+0100
@@ -0,0 +1,473 @@
+/*
+ * Freescale MPC5554 Device Tree Source
+ *
+ * Based on MPC5553/5554 Microcontroller Reference Manual, Rev. 4.0, 04/2007
+ * http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf
+ *  - Block Diagram: page 1-3, Figure 1-1
+ *  - Memory Map: page 1-21, Table 1-2
+ *  - Interrupt Request Sources: page 10-16, Table 10-9
+ *
+ * Copyright 2010 Márton Németh
+ * Márton Németh 
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+/ {
+   model = "MPC5554";
+   compatible = "fsl,MPC5554EVB";  // Freescale MPC5554 Evaluation 
Board
+   #address-cells = <1>;
+   #size-cells = <1>;
+   interrupt-parent = <&intc>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   c...@0 {
+   device_type = "cpu";
+   compatible = "PowerPC,5554", "fsl,mpc5554-e200z6", 
"fsl,powerpc-e200z6";
+   reg = <0>;
+   d-cache-line-size = <32>;
+   i-cache-line-size = <32>;
+   d-cache-size = <0x8000>;// L1, 32KiB
+   i-cache-size = <0x8000>;// L1, 32KiB
+   timebase-frequency = <0>;   // from bootloader
+   bus-frequency = <0>;// from bootloader
+   clock-frequency = <0>;  // from bootloader
+   };
+   };
+
+   mem...@4000 {
+   device_type = "memory";
+   reg = <0x4000 0x1>; // 32KiB internal SRAM
+   };
+
+   x...@fff04000 { // System Bus Crossbar Switch (XBAR)
+   compatible = "fsl,mpc5554-xbar";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   // The full memory range is covered by XBAR
+   ranges;
+   reg = <0xfff04000 0x4000>;
+
+   fl...@0 {   // read-only FLASH
+   compatible = "fsl,mpc5554-flash";
+   reg = <0x 0x20>;// 2MiB internal FLASH
+   };
+
+   bri...@c3f0 {
+   compatible = "fsl,mpc5554-pbridge-a";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0xc000 0x2000>;
+   reg = <0xc3f0 0x4000>;
+
+   fm...@3f8 { // Frequency Modulated PLL
+   compatible = "fsl,mpc5554-fmpll";
+   reg = <0x03f8 0x4000>;
+   interrupts = <43 1  // Loss of Clock
+ 44 1>;// Loss of Lock
+   };
+
+   flashcon...@3f88000 {   // Flash Configuration
+   compatible = "fsl,mpc5554-flashconfig";
+   reg = <0x03f88000 0x4000>;
+   };
+
+   s...@3f89000 {  // System Integration Unit
+   compatible = "fsl,mpc5554-siu";
+   reg = <0x03f9 0x4000>;
+   interrupts = <45 1  // External Interrupt 
Overrun 0-15
+ 46 1  // External Interrupt 0
+ 47 1  // External Interrupt 1
+ 48 1  // External Interrupt 2
+ 49 1  // External Interrupt 3
+ 50 1>;// External Interrupt 
4-15
+   };
+
+   em...@3fa { // Modular Timer System
+   compatible = "fsl,mpc5554-emios";
+ 

[PATCH] powerpc: do not call printk when CONFIG_PRINTK is not defined

2010-03-11 Thread Németh Márton
From: Márton Németh 

When printk() is disabled (CONFIG_PRINTK) at menu item
 General setup
 -> Configure standard kernel features (for small systems)
-> Enable support for printk
then there should be no printk() calls at all.

Signed-off-by: Márton Németh 
---

Just a typo was fixed in the title.

---
diff -upr linux-2.6.33.orig/arch/powerpc/kernel/head_fsl_booke.S 
linux/arch/powerpc/kernel/head_fsl_booke.S
--- linux-2.6.33.orig/arch/powerpc/kernel/head_fsl_booke.S  2010-02-24 
19:52:17.0 +0100
+++ linux/arch/powerpc/kernel/head_fsl_booke.S  2010-03-07 09:28:05.0 
+0100
@@ -887,13 +887,17 @@ KernelSPE:
lwz r3,_MSR(r1)
orisr3,r3,msr_...@h
stw r3,_MSR(r1) /* enable use of SPE after return */
+#ifdef CONFIG_PRINTK
lis r3,8...@h
ori r3,r3,8...@l
mr  r4,r2   /* current */
lwz r5,_NIP(r1)
bl  printk
+#endif
b   ret_from_except
+#ifdef CONFIG_PRINTK
 87:.string "SPE used in kernel  (task=%p, pc=%x)  \n"
+#endif
.align  4,0

 #endif /* CONFIG_SPE */

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Freescale MPC5554 device tree (was: cross-compiling Linux for PowerPC e200 core?)

2010-03-11 Thread Németh Márton
Hi,

thank you for the comments, I reworked the Freescale MPC5554 device tree
accordingly. I'm listening for comments on this draft.

Regards,

Márton Németh

---
From: Márton Németh 

Add device tree for Freescale MPC5554.

Signed-off-by: Márton Németh 
---
diff -uprN linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 
linux/arch/powerpc/boot/dts/mpc5554.dts
--- linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 1970-01-01 
01:00:00.0 +0100
+++ linux/arch/powerpc/boot/dts/mpc5554.dts 2010-03-12 07:22:37.0 
+0100
@@ -0,0 +1,189 @@
+/*
+ * Freescale MPC5554 Device Tree Source
+ *
+ * Based on MPC5553/5554 Microcontroller Reference Manual, Rev. 4.0, 04/2007
+ * http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf
+ *
+ * Copyright 2010 Márton Németh
+ * Márton Németh 
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+/ {
+   model = "MPC5554";
+   compatible = "fsl,MPC5554EVB";  // Freescale MPC5554 Evaluation 
Board
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   c...@0 {
+   device_type = "cpu";
+   compatible = "PowerPC,5554";
+   reg = <0>;
+   d-cache-line-size = <32>;
+   i-cache-line-size = <32>;
+   d-cache-size = <0x8000>;// L1, 32KiB
+   i-cache-size = <0x8000>;// L1, 32KiB
+   timebase-frequency = <0>;   // from bootloader
+   bus-frequency = <0>;// from bootloader
+   clock-frequency = <0>;  // from bootloader
+   };
+   };
+
+   mem...@4000 {
+   device_type = "memory";
+   reg = <0x4000 0x1>; // 32KiB internal SRAM
+   };
+
+   x...@fff04000 { // System Bus Crossbar Switch (XBAR)
+   compatible = "fsl,mpc5554-xbar";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   // The full memory range is covered by XBAR
+   ranges = <>;
+   reg = <0xfff04000 0x4000>;
+
+   fl...@0 {   // read-only FLASH
+   compatible = "fsl,mpc5554-flash";
+   reg = <0x 0x20>;// 2MiB internal FLASH
+   };
+
+   bri...@c3f0 {
+   compatible = "fsl,mpc5554-pbridge-a";
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0xc000 0x2000>;
+   reg = <0xc3f0 0x4000>;
+
+   fm...@3f8 { // Frequency Modulated PLL
+   compatible = "fsl,mpc5554-fmpll";
+   reg = <0x03f8 0x4000>;
+   };
+
+   flashcon...@3f88000 {   // Flash Configuration
+   compatible = "fsl,mpc5554-flashconfig";
+   reg = <0x03f88000 0x4000>;
+   };
+
+   s...@3f89000 {  // System Integration Unit
+   compatible = "fsl,mpc5554-siu";
+   reg = <0x03f9 0x4000>;
+   };
+
+   em...@3fa { // Modular Timer System
+   compatible = "fsl,mpc5554-emios";
+   reg = <0x03fa 0x4000>;
+   };
+
+   e...@3fc {  // Enhanced Time Processing Unit
+   compatible = "fsl,mpc5554-etpu";
+   reg = <0x03fc 0x4000>;
+   };
+
+   etpud...@3fc8000 {  // eTPU Shared Data Memory 
(Parameter RAM)
+   compatible = "fsl,mpc5554-etpudata";
+   reg = <0x03fc8000 0x4000>;
+   };
+
+   etpud...@3fcc000 {  // eTPU Shared Data Memory 
(Parameter RAM) mirror
+   compatible = "fsl,mpc5554-etpudata";
+   reg = <0x03fcc000 0x4000>;
+   

Re: Freescale MPC5554 device tree (was: cross-compiling Linux for PowerPC e200 core?)

2010-03-10 Thread Németh Márton
Grant Likely wrote:
> 2010/3/9 Németh Márton :
>> Hi,
>> Grant Likely wrote:
>>> 2010/3/8 Németh Márton :
[snip]
>>>> As far as I could find out I'll need to create a device tree as documented 
>>>> in
>>>> the linux/Documentation/powerpc/booting-without-of.txt file.
>>> Yes, you'll need to create a device tree file for the board.  Again,
>>> start from an existing 5200 .dts file.  You won't need very much in it
>>> to get started.  I'd be happy to help you get the structure right.
>> I tried to create a first draft of the deveice tree for MPC5554. It is
>> compilable with dtc. I based this .dts file on Figure 1-1 on page 1-3 and
>> Table 1-2 on page 1-21 of 
>> http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf .
>>
>> I'm not sure about the following points:
>> 1. Where should be the on-chip FLASH described? This memory is read-only from
>>   view of software and can be used to store read-only data or execute code 
>> directly
>>   from there.
> 
> Hang it off the xbar node.  Name it flash@, and use
> 'compatible = "fsl,mpc5554-flash";'
> 
>> 2. Should the co-processor (eTPU in this case) also listed in section "cpus"
>>   or not? This co-processor is not able to run code like the e200z6.
> 
> No, this is a device.  Hang it off the peripheral bridge a node.
> 
>> 3. There are three on-chip buses on MPC5554:
>>   - Crossbar Switch (XBAR)
>>   - Peripheral Bridge A (PBRIDGE_A)
>>   - Peripheral Bridge B (PBRIDGE_B)
>>   I used PBRIDGE_A and PRIDGE_B to create two /soc entries. Is this 
>> possible?
> 
> the soc5200 naming was poorly chosen when the 5200 device tree was
> written.  Use something like this:
> 
> xbar@ {
> compatible = "fsl,mpc5554-xbar";
> #address-cells = <1>;
> #size-cells = <1>;
> ranges = <[put the translation ranges in here]>;
> reg = ;
> 
> bridge@ {
> compatible = "fsl,mpc5554-pbridge-a";
> #address-cells = <1>;
> #size-cells = <1>;
> ranges = <[put the translation ranges in here]>;
> reg = ;
> [... child device nodes ...]
> };
> bridge@ {
> compatible = "fsl,mpc5554-pbridge-b";
> #address-cells = <1>;
> #size-cells = <1>;
> ranges = <[put the translation ranges in here]>;
> reg = ;
> [... child device nodes ...]
> };
> };
> 
> The idea is to use generic names for the node names, and identify
> exactly what the device is by using the "compatible" property.  Also,
> the aim is to build up a tree describing the interconnection of device
> from the perspective of the OS on the CPU.  ie.  the full physical
> address space is represented by the root node of the tree, and
> everything else hangs off that.
> 
>> 4. There are modules which have multiple instances at different base 
>> addresses. These
>>   are DSPI, SCI and FlexCAN. I used the same name for them but with 
>> different addresses.
>>   Is this correct?
> 
> yes.
[snip]

Here is the next draft version of the Freescale MPC5554 device tree.

I'm not quite sure whether the mem...@4000 should go under xbar or stay
directly under the root node.

The second problem I faced with was that XBAR covers the whole address range.
However, if I specify "ranges = <0 0x 0x1>;" then I get an
error message because of the too big length value:

| DTC: dts->dts  on file "/usr/src/linux/arch/powerpc/boot/dts/mpc5554.dts"
| /usr/src/linux/arch/powerpc/boot/dts/mpc5554.dts:51 literal out of range
| FATAL ERROR: Syntax error parsing input tree

I tried to solve this problem by assuming that leaving out the "ranges = ..."
means the whole range. Is this correct?

Regards,

Márton Németh
---
From: Márton Németh 

Add device tree for Freescale MPC5554.

Signed-off-by: Márton Németh 
---
diff -uprN linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 
linux/arch/powerpc/boot/dts/mpc5554.dts
--- linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 1970-01-01 
01:00:00.0 +0100
+++ linux/arch/powerpc/boot/dts/mpc5554.dts 2010-03-11 07:01:29.0 
+0100
@@ -0,0 +1,188 @@
+/*
+ * Freescale MPC5554 Device Tree Source
+ *
+ * Based on MPC5553/5554 Microcontroller Reference Manual, Rev. 4.0, 04/2007
+ * http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf
+ *
+ * Copyright

Re: cross-compiling Linux for PowerPC e200 core?

2010-03-08 Thread Németh Márton
Hi,
Grant Likely wrote:
> 2010/3/8 Németh Márton :
>> Grant Likely wrote:
>>> 2010/3/6 Németh Márton :
>>>> Hi,
>>>>
>>>> I'm trying to cross-compile Linux 2.6.33 for Freescale MPC5554 [1][2]. This
>>>> microcontroller is based on the e200z6 core. I could build the 
>>>> cross-development
>>>> tools, but I could miss something because I get an error message when 
>>>> building
>>>> Linux for PowerPC e200 core. Here are the steps I used:
>>> I doubt you'll have much luck with the mpc5554.  Linux doesn't include
>>> any support for the MPC5554, and I don't think anybody is working on
>>> it.  Any of the mpc5554 systems I've see don't have enough ram to run
>>> Linux well.
>> I'm ready to work a bit more than just compiling the kernel and run it on 
>> MPC5554.
>> On my target system there is a possibility to use external RAM connected to 
>> the
>> External Bus Interface, so I don't see this would be a problem in my case.
>>
>> However, I have not much experience running Linux on PowerPC environment. 
>> Could
>> you suggest a PowerPC port which would be a good starting point to make 
>> support
>> for MPC5554?
> 
> I'd use the MPC5200 board support as a starting point
> (arch/powerpc/platforms/52xx).  Create yourself a new directory for
> this platform (arch/powerpc/platforms/55xx)
> 
>> As far as I could find out I'll need to create a device tree as documented in
>> the linux/Documentation/powerpc/booting-without-of.txt file.
> 
> Yes, you'll need to create a device tree file for the board.  Again,
> start from an existing 5200 .dts file.  You won't need very much in it
> to get started.  I'd be happy to help you get the structure right.

I tried to create a first draft of the deveice tree for MPC5554. It is
compilable with dtc. I based this .dts file on Figure 1-1 on page 1-3 and
Table 1-2 on page 1-21 of 
http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf .

I'm not sure about the following points:
1. Where should be the on-chip FLASH described? This memory is read-only from
   view of software and can be used to store read-only data or execute code 
directly
   from there.

2. Should the co-processor (eTPU in this case) also listed in section "cpus"
   or not? This co-processor is not able to run code like the e200z6.

3. There are three on-chip buses on MPC5554:
   - Crossbar Switch (XBAR)
   - Peripheral Bridge A (PBRIDGE_A)
   - Peripheral Bridge B (PBRIDGE_B)
   I used PBRIDGE_A and PRIDGE_B to create two /soc entries. Is this 
possible?

4. There are modules which have multiple instances at different base addresses. 
These
   are DSPI, SCI and FlexCAN. I used the same name for them but with different 
addresses.
   Is this correct?

Regards,

Márton Németh
---
From: Márton Németh 

Add device tree for Freescale MPC5554.

Signed-off-by: Márton Németh 
---
diff -uprN linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 
linux/arch/powerpc/boot/dts/mpc5554.dts
--- linux-2.6.33.orig/arch/powerpc/boot/dts/mpc5554.dts 1970-01-01 
01:00:00.0 +0100
+++ linux/arch/powerpc/boot/dts/mpc5554.dts 2010-03-09 07:40:46.0 
+0100
@@ -0,0 +1,197 @@
+/*
+ * Freescale MPC5554 Device Tree Source
+ *
+ * Based on MPC5553/5554 Microcontroller Reference Manual, Rev. 4.0, 04/2007
+ * http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf
+ *
+ * Copyright 2010 Márton Németh
+ * Márton Németh 
+ *
+ * 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.
+ */
+
+/dts-v1/;
+
+/ {
+   model = "MPC5554";
+   compatible = "MPC5554";
+   #address-cells = <1>;
+   #size-cells = <1>;
+
+   cpus {
+   #address-cells = <1>;
+   #size-cells = <0>;
+
+   PowerPC,5...@0 {
+   device_type = "cpu";
+   reg = <0>;
+   d-cache-line-size = <32>;
+   i-cache-line-size = <32>;
+   d-cache-size = <0x8000>;// L1, 32KiB
+   i-cache-size = <0x8000>;// L1, 32KiB
+   timebase-frequency = <0>;   // from bootloader
+   bus-frequency = <0>;// from bootloader
+   clock-frequency = <0>;  // from bootloader
+   };
+   };
+
+   flash { // read-only FLASH
+

Re: cross-compiling Linux for PowerPC e200 core?

2010-03-08 Thread Németh Márton
Hi,
Segher Boessenkool wrote:
>> Assembler messages:
>> Error: invalid switch -me200
>> Error: unrecognized option -me200
> 
> No version of mainline binutils supports this.
> 
> This kernel code was added in 2005, in 33d9e9b, by FSL; perhaps
> they have a fork of binutils that supports it, maybe they forgot
> to submit the changes upstream?

I'm a bit new on the topic, could you please describe what FSL means?

I'm also having problems finding the commit 33d9e9b in the git repository
at http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git .

Regards,

Márton Németh
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: cross-compiling Linux for PowerPC e200 core?

2010-03-08 Thread Németh Márton
Grant Likely wrote:
> 2010/3/6 Németh Márton :
>> Hi,
>>
>> I'm trying to cross-compile Linux 2.6.33 for Freescale MPC5554 [1][2]. This
>> microcontroller is based on the e200z6 core. I could build the 
>> cross-development
>> tools, but I could miss something because I get an error message when 
>> building
>> Linux for PowerPC e200 core. Here are the steps I used:
> 
> I doubt you'll have much luck with the mpc5554.  Linux doesn't include
> any support for the MPC5554, and I don't think anybody is working on
> it.  Any of the mpc5554 systems I've see don't have enough ram to run
> Linux well.

I'm ready to work a bit more than just compiling the kernel and run it on 
MPC5554.
On my target system there is a possibility to use external RAM connected to the
External Bus Interface, so I don't see this would be a problem in my case.

However, I have not much experience running Linux on PowerPC environment. Could
you suggest a PowerPC port which would be a good starting point to make support
for MPC5554?

As far as I could find out I'll need to create a device tree as documented in
the linux/Documentation/powerpc/booting-without-of.txt file.

Regards,

Márton Németh
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Linux on Freescale e200

2010-03-07 Thread Németh Márton
Hi Per-Erik,

I found your message at
http://lists.ozlabs.org/pipermail/linuxppc-dev/2007-December/048539.html
back from Dec 2007.

Have you managed to run Linux on phyCORE-MPC5554 since then?

Regards,

Márton Németh

>>> Hi
>>>
>>> I'm wondering if someone has ever tried to get Linux running on a
>>> Freescale e200 core?
>>> I found a patch to the Linux kernel from back in 2005:
>>> (http://linux.derkeiler.com/Mailing-Lists/Kernel/2005-06/5731.html)
>>> And it is listed as a processor type in Linux-2.6.23.11
>>> I know that there has been some confusion about e200 and e500 cores,
>>> old
>>> e200 renamed to e500, but from what I understand the e200 core now
>>> listed
>>> in the kernel is the one currently being used in MPC55xx
>>>
>>> I'm having a MPC5554, e200z6 core, that I'm supposed to get Linux
>>> running
>>> on (master thesis) and any pointers and tips are appreciated.
>>> Just finished porting/tweaking the Redboot boot loader, and I'm now
>>> moving
>>> on to the Linux (porting?) part.
>>
>> I'd suggest looking at getting u-boot running instead since that's we
>> use on the majority of freescale PPCs.
>>
>> We did a port a while back to the e200.. so most of the basic bits
>> should be there.  There might be some bit rot from its like of usage.
>>
>> What peripheral set are you looking to get working on the 5554?
>>
>> - k
>>
>
> Had a look into UBoot at first but didn't find any port for the
> MPC55xx/e200, so when we stumbled upon a "working" ecos/redboot port we
> went with that..
> Do you know where I could find the uboot port for the e200?
>
> We have phycore dev. kit
> (http://www.phytec.com/products/rdk/PowerPC/phyCORE-MPC5554.html)
> Just supposed to get it up and running, so peripherals will just be
> serial, ethernet and maybe CAN.
>
> / Per-Erik
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

[PATCH] powerpc: do not call prink when CONFIG_PRINTK is not defined

2010-03-07 Thread Németh Márton
From: Márton Németh 

When printk() is disabled (CONFIG_PRINTK) at menu item
 General setup
 -> Configure standard kernel features (for small systems)
-> Enable support for printk
then there should be no printk() calls at all.

Signed-off-by: Márton Németh 
---
diff -upr linux-2.6.33.orig/arch/powerpc/kernel/head_fsl_booke.S 
linux/arch/powerpc/kernel/head_fsl_booke.S
--- linux-2.6.33.orig/arch/powerpc/kernel/head_fsl_booke.S  2010-02-24 
19:52:17.0 +0100
+++ linux/arch/powerpc/kernel/head_fsl_booke.S  2010-03-07 09:28:05.0 
+0100
@@ -887,13 +887,17 @@ KernelSPE:
lwz r3,_MSR(r1)
orisr3,r3,msr_...@h
stw r3,_MSR(r1) /* enable use of SPE after return */
+#ifdef CONFIG_PRINTK
lis r3,8...@h
ori r3,r3,8...@l
mr  r4,r2   /* current */
lwz r5,_NIP(r1)
bl  printk
+#endif
b   ret_from_except
+#ifdef CONFIG_PRINTK
 87:.string "SPE used in kernel  (task=%p, pc=%x)  \n"
+#endif
.align  4,0

 #endif /* CONFIG_SPE */
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

cross-compiling Linux for PowerPC e200 core?

2010-03-06 Thread Németh Márton
Hi,

I'm trying to cross-compile Linux 2.6.33 for Freescale MPC5554 [1][2]. This
microcontroller is based on the e200z6 core. I could build the cross-development
tools, but I could miss something because I get an error message when building
Linux for PowerPC e200 core. Here are the steps I used:

$ tar xjvRf binutils-2.20.tar.bz2
$ mkdir binutils-build
$ cd binutils-build
$ ../binutils-2.20/configure --target=powerpc-linux-gnuspe 
--prefix=/home/nmarci/usr/local
$ make
$ make install
$ cd ..
$ export PATH=$PATH:/home/nmarci/usr/local/binutils/bin
$ tar xjvRf gcc-core-4.4.2.tar.bz2
$ mkdir gcc-build
$ cd gcc-build
$ ../gcc-4.4.2/configure --target=powerpc-linux-gnuspe 
--prefix=/home/nmarci/usr/local --disable-shared --disable-threads 
--enable-languages=c
$ make all-gcc
$ make install-gcc
$ cd ..
$ tar xjvRf linux-2.6.33.tar.bz2
$ ln -s linux-2.6.33 linux
$ cd linux
$ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnuspe- menuconfig
$ make ARCH=powerpc CROSS_COMPILE=powerpc-linux-gnuspe- vmlinux
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/basic/docproc
  HOSTCC  scripts/basic/hash
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/kxgettext.o
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
scripts/kconfig/conf -s arch/powerpc/Kconfig
  CHK include/linux/version.h
  CHK include/generated/utsrelease.h
  CC  kernel/bounds.s
  GEN include/generated/bounds.h
  CC  arch/powerpc/kernel/asm-offsets.s
  GEN include/generated/asm-offsets.h
  CALLscripts/checksyscalls.sh
:1523:2: warning: #warning syscall recvmmsg not implemented
  HOSTCC  scripts/dtc/checks.o
  HOSTCC  scripts/dtc/data.o
  HOSTCC  scripts/dtc/dtc-lexer.lex.o
  HOSTCC  scripts/dtc/dtc-parser.tab.o
  HOSTCC  scripts/dtc/dtc.o
  HOSTCC  scripts/dtc/flattree.o
  HOSTCC  scripts/dtc/fstree.o
  HOSTCC  scripts/dtc/livetree.o
  HOSTCC  scripts/dtc/srcpos.o
  HOSTCC  scripts/dtc/treesource.o
  HOSTLD  scripts/dtc/dtc
  CC  scripts/mod/empty.o
Assembler messages:
Error: invalid switch -me200
Error: unrecognized option -me200
make[2]: *** [scripts/mod/empty.o] Error 2
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2

I attach the kernel .config I used. I guess the assembler I built misses the 
support
for e200 core. How can enable it?

References:
[1] Freescale MPC5554
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC5554

[2] MPC5553/MPC5554 Microcontroller Reference Manual
http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf

Regards,

Márton Németh
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.33
# Sun Mar  7 07:40:17 2010
#
# CONFIG_PPC64 is not set

#
# Processor support
#
# CONFIG_PPC_BOOK3S_32 is not set
# CONFIG_PPC_85xx is not set
# CONFIG_PPC_8xx is not set
# CONFIG_40x is not set
# CONFIG_44x is not set
CONFIG_E200=y
CONFIG_BOOKE=y
CONFIG_FSL_BOOKE=y
CONFIG_SPE=y
CONFIG_PPC_MMU_NOHASH=y
CONFIG_PPC_MMU_NOHASH_32=y
CONFIG_PPC_BOOK3E_MMU=y
# CONFIG_PPC_MM_SLICES is not set
# CONFIG_SMP is not set
CONFIG_NOT_COHERENT_CACHE=y
CONFIG_PPC32=y
CONFIG_WORD_SIZE=32
# CONFIG_ARCH_PHYS_ADDR_T_64BIT is not set
CONFIG_MMU=y
CONFIG_GENERIC_CMOS_UPDATE=y
CONFIG_GENERIC_TIME=y
CONFIG_GENERIC_TIME_VSYSCALL=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_HARDIRQS=y
CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y
# CONFIG_HAVE_SETUP_PER_CPU_AREA is not set
# CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK is not set
CONFIG_IRQ_PER_CPU=y
CONFIG_NR_IRQS=512
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_HAVE_LATENCYTOP_SUPPORT=y
CONFIG_TRACE_IRQFLAGS_SUPPORT=y
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
CONFIG_ARCH_HAS_ILOG2_U32=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_GENERIC_FIND_NEXT_BIT=y
# CONFIG_ARCH_NO_VIRT_TO_BUS is not set
CONFIG_PPC=y
CONFIG_EARLY_PRINTK=y
CONFIG_GENERIC_NVRAM=y
CONFIG_SCHED_OMIT_FRAME_POINTER=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_PPC_OF=y
CONFIG_OF=y
# CONFIG_PPC_UDBG_16550 is not set
# CONFIG_GENERIC_TBSYNC is not set
CONFIG_AUDIT_ARCH=y
CONFIG_GENERIC_BUG=y
CONFIG_DTC=y
# CONFIG_DEFAULT_UIMAGE is not set
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
# CONFIG_PPC_DCR_NATIVE is not set
# CONFIG_PPC_DCR_MMIO is not set
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config"
CONFIG_CONSTRUCTORS=y

#
# General setup
#
# CONFIG_EXPERIMENTAL is not set
CONFIG_BROKEN_ON_SMP=y
CONFIG_INIT_ENV_ARG_LIMIT=32
CONFIG_LOCALVERSION=""
CONFIG_LOCALVERSION_AUTO=y
# CONFIG_SWAP is not set
# CONFIG_SYSVIPC is not set
# CONFIG_BSD_PROCESS_ACCT is not set

#
# RCU Subsystem
#
CONFIG_TREE_RCU=y
# CONFIG_TREE_PREEMPT_RCU is not set
# CONFIG_TINY_RCU is not set
# CONFIG_RCU_TRACE is not set
CONFIG_RCU_FANOUT=32
# CONFIG_RCU_FANOUT_EXACT is not set
# CONFIG_TREE_RCU_TRACE is not set
# CONFIG_IKCONFIG is not set
CONFIG_LOG_BUF_SHIFT=17
# CONFIG_CGROUPS is not set
# CONFIG_SYSFS_DEPRECATED_V2 is not set
# CONFIG_RELAY is not set
CONFIG_NAMESPACES=y
# CONFIG_UTS_NS is not set
# CONFIG_BLK_DEV_INITRD

[PATCH] macintosh: make Open Firmware device id constant

2010-01-10 Thread Németh Márton
From: Márton Németh 

The match_table field of the struct of_device_id is constant in 

so it is worth to make the initialization data also constant.

The semantic match that finds this kind of pattern is as follows:
(http://coccinelle.lip6.fr/)

// 
@r@
disable decl_init,const_decl_init;
identifier I1, I2, x;
@@
struct I1 {
  ...
  const struct I2 *x;
  ...
};
@s@
identifier r.I1, y;
identifier r.x, E;
@@
struct I1 y = {
  .x = E,
};
@c@
identifier r.I2;
identifier s.E;
@@
const struct I2 E[] = ... ;
@depends on !c@
identifier r.I2;
identifier s.E;
@@
+   const
struct I2 E[] = ...;
// 

Signed-off-by: Márton Németh 
Cc: Julia Lawall 
Cc: co...@diku.dk
---
diff -u -p a/drivers/macintosh/therm_windtunnel.c 
b/drivers/macintosh/therm_windtunnel.c
--- a/drivers/macintosh/therm_windtunnel.c 2010-01-07 19:08:40.0 +0100
+++ b/drivers/macintosh/therm_windtunnel.c 2010-01-08 04:47:10.0 +0100
@@ -457,7 +457,7 @@ therm_of_remove( struct of_device *dev )
return 0;
 }

-static struct of_device_id therm_of_match[] = {{
+static const struct of_device_id therm_of_match[] = {{
.name   = "fan",
.compatible = "adm1030"
 }, {}
diff -u -p a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
--- a/drivers/macintosh/smu.c 2009-12-03 04:51:21.0 +0100
+++ b/drivers/macintosh/smu.c 2010-01-08 04:47:28.0 +0100
@@ -660,7 +660,7 @@ static int smu_platform_probe(struct of_
return 0;
 }

-static struct of_device_id smu_platform_match[] =
+static const struct of_device_id smu_platform_match[] =
 {
{
.type   = "smu",
diff -u -p a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
--- a/drivers/macintosh/therm_pm72.c 2009-12-03 04:51:21.0 +0100
+++ b/drivers/macintosh/therm_pm72.c 2010-01-08 04:50:17.0 +0100
@@ -2211,7 +2211,7 @@ static int fcu_of_remove(struct of_devic
return 0;
 }

-static struct of_device_id fcu_match[] =
+static const struct of_device_id fcu_match[] =
 {
{
.type   = "fcu",
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: Linux for MPC5554 or MPC5534 (core e200z6)?

2009-10-21 Thread Németh Márton
Kumar Gala wrote:
> On Oct 20, 2009, at 5:21 PM, Németh Márton wrote:
> 
>> Hi Grant,
>> Hello List,
>>
>> is there anybody who was successfully run Linux kernel on Freescale  
>> MPC5554
>> [1], [2] or on Freescale MPC5534 [3], [4]? Both of these embedded  
>> PowerPC
>> controllers have the e200z6 core.
>>
>> Is there anybody who is working with these controllers or with the  
>> e200z6 core?
>>
>> References:
>> [1] Freescale MPC5554
>>http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC5554
>>
>> [2] MPC5553/MPC5554 Microcontroller Reference Manual
>>http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf
>>
>> [3] Freescale MPC5534
>> http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC5534
>>
>> [4] MPC5534 Microcontroller Reference Manual
>>http://www.freescale.com/files/32bit/doc/ref_manual/MPC5534RM.pdf
> 
> I'm not aware of anyone working on Linux for these chips based on the  
> e200z6.  What application do you have that you want to run Linux on  
> them?

At this time I am just looking to see what kind of operating systems these
chips can run. I think the first step to run Linux would be that the MMU
and serial console starts to work then maybe I would check how the PF_CAN
interface ( http://lwn.net/Articles/253425/ ) would work on this device
if a FlexCAN2 driver is available.

Is there any other powerpc port with e200z6 core?

Regards,

Márton Németh
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Linux for MPC5554 or MPC5534 (core e200z6)?

2009-10-21 Thread Németh Márton
Hi Grant,
Hello List,

is there anybody who was successfully run Linux kernel on Freescale MPC5554
[1], [2] or on Freescale MPC5534 [3], [4]? Both of these embedded PowerPC
controllers have the e200z6 core.

Is there anybody who is working with these controllers or with the e200z6 core?

References:
[1] Freescale MPC5554
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC5554

[2] MPC5553/MPC5554 Microcontroller Reference Manual
http://www.freescale.com/files/32bit/doc/ref_manual/MPC5553_MPC5554_RM.pdf

[3] Freescale MPC5534
http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MPC5534

[4] MPC5534 Microcontroller Reference Manual
http://www.freescale.com/files/32bit/doc/ref_manual/MPC5534RM.pdf

Regards,

Márton Németh

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev