* [PATCH] lite5200b: flash definition in dts
@ 2007-06-19 9:54 Domen Puncer
2007-08-01 6:52 ` Domen Puncer
0 siblings, 1 reply; 7+ messages in thread
From: Domen Puncer @ 2007-06-19 9:54 UTC (permalink / raw)
To: linuxppc-embedded
Add flash definition for flash on lite5200b, and while at it
fix "ranges" for soc node.
Kernel now writes:
[ 11.159134] fe000000.flash: Found 2 x8 devices at 0x0 in 16-bit bank
[ 11.165696] Amd/Fujitsu Extended Query Table at 0x0040
[ 11.171109] fe000000.flash: CFI does not contain boot bank location. Assuming top.
[ 11.178911] number of CFI chips: 1
[ 11.182427] cfi_cmdset_0002: Disabling erase-suspend-program due to code brokenness.
[ 11.190402] RedBoot partition parsing not available
[ 11.195449] physmap-flash fe000000.flash: Using OF partition information
[ 11.202359] Creating 2 MTD partitions on "fe000000.flash":
[ 11.208023] 0x00000000-0x01f00000 : "data"
[ 11.213712] 0x01f00000-0x02000000 : "u-boot"
I have not managed to write anything to flash from Linux, ideas?
JEDEC probe does not succeed.
CFI does (cfi_ident struct is filled and "looks" OK),
but mfr and id are 0xffff.
Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
---
arch/powerpc/boot/dts/lite5200b.dts | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
Index: work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
===================================================================
--- work-powerpc.git.orig/arch/powerpc/boot/dts/lite5200b.dts
+++ work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
@@ -52,11 +52,23 @@
revision = ""; // from bootloader
#interrupt-cells = <3>;
device_type = "soc";
- ranges = <0 f0000000 f0010000>;
+ ranges = <00000000 f0000000 00010000
+ fe000000 fe000000 02000000>;
reg = <f0000000 00010000>;
bus-frequency = <0>; // from bootloader
system-frequency = <0>; // from bootloader
+ flash@fe000000 {
+ device_type = "rom";
+ compatible = "direct-mapped";
+ probe-type = "CFI";
+ reg = <fe000000 02000000>;
+ bank-width = <2>;
+ partitions = <00000000 01f00000
+ 01f00000 00100000>;
+ partition-names = "data", "u-boot";
+ };
+
cdm@200 {
compatible = "mpc5200b-cdm\0mpc5200-cdm";
reg = <200 38>;
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH] lite5200b: flash definition in dts
2007-06-19 9:54 [PATCH] lite5200b: flash definition in dts Domen Puncer
@ 2007-08-01 6:52 ` Domen Puncer
2007-08-01 12:41 ` Grant Likely
0 siblings, 1 reply; 7+ messages in thread
From: Domen Puncer @ 2007-08-01 6:52 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: Sylvain Munaut
Add flash definition for to lite5200b dts, and while at it
fix "ranges" for soc node.
Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
---
Hi!
Sylvain, it would be nice to have this merged.
# cat /proc/mtd
dev: size erasesize name
mtd0: 01000000 00020000 "data0"
mtd1: 00f00000 00020000 "data1"
mtd2: 00100000 00020000 "u-boot"
Some benchmarks:
read: 2.3 MB/s
erase: 168 kB/s
write: 7.3 kB/s
arch/powerpc/boot/dts/lite5200b.dts | 24 +++++++++++++++++++++++-
1 file changed, 23 insertions(+), 1 deletion(-)
Index: work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
===================================================================
--- work-powerpc.git.orig/arch/powerpc/boot/dts/lite5200b.dts
+++ work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
@@ -52,7 +52,8 @@
revision = ""; // from bootloader
#interrupt-cells = <3>;
device_type = "soc";
- ranges = <0 f0000000 f0010000>;
+ ranges = <00000000 f0000000 00010000
+ fe000000 fe000000 02000000>;
reg = <f0000000 00010000>;
bus-frequency = <0>; // from bootloader
system-frequency = <0>; // from bootloader
@@ -403,5 +404,26 @@
compatible = "mpc5200b-sram\0mpc5200-sram\0sram";
reg = <8000 4000>;
};
+
+ flash@fe000000 {
+ device_type = "rom";
+ compatible = "direct-mapped";
+ probe-type = "CFI";
+ reg = <fe000000 01000000>;
+ bank-width = <1>;
+ partitions = <00000000 01000000>;
+ partition-names = "data0";
+ };
+
+ flash@ff000000 {
+ device_type = "rom";
+ compatible = "direct-mapped";
+ probe-type = "CFI";
+ reg = <ff000000 01000000>;
+ bank-width = <1>;
+ partitions = <00000000 00f00000
+ 00f00000 00100000>;
+ partition-names = "data1", "u-boot";
+ };
};
};
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] lite5200b: flash definition in dts
2007-08-01 6:52 ` Domen Puncer
@ 2007-08-01 12:41 ` Grant Likely
2007-08-02 5:58 ` Domen Puncer
0 siblings, 1 reply; 7+ messages in thread
From: Grant Likely @ 2007-08-01 12:41 UTC (permalink / raw)
To: Domen Puncer; +Cc: linuxppc-embedded
On 8/1/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> Add flash definition for to lite5200b dts, and while at it
> fix "ranges" for soc node.
>
>
> Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
>
> ---
> Hi!
>
> Sylvain, it would be nice to have this merged.
>
> # cat /proc/mtd
> dev: size erasesize name
> mtd0: 01000000 00020000 "data0"
> mtd1: 00f00000 00020000 "data1"
> mtd2: 00100000 00020000 "u-boot"
>
> Some benchmarks:
> read: 2.3 MB/s
> erase: 168 kB/s
> write: 7.3 kB/s
>
>
> arch/powerpc/boot/dts/lite5200b.dts | 24 +++++++++++++++++++++++-
> 1 file changed, 23 insertions(+), 1 deletion(-)
>
> Index: work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
> ===================================================================
> --- work-powerpc.git.orig/arch/powerpc/boot/dts/lite5200b.dts
> +++ work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
> @@ -52,7 +52,8 @@
> revision = ""; // from bootloader
> #interrupt-cells = <3>;
> device_type = "soc";
> - ranges = <0 f0000000 f0010000>;
> + ranges = <00000000 f0000000 00010000
> + fe000000 fe000000 02000000>;
I don't think this is the right approach. I think the SoC node is
intended for describing the on-chip devices, and the ranges property
reflects that. Shouldn't flash nodes be up 1 level?
Cheers,
g.
> reg = <f0000000 00010000>;
> bus-frequency = <0>; // from bootloader
> system-frequency = <0>; // from bootloader
> @@ -403,5 +404,26 @@
> compatible = "mpc5200b-sram\0mpc5200-sram\0sram";
> reg = <8000 4000>;
> };
> +
> + flash@fe000000 {
> + device_type = "rom";
> + compatible = "direct-mapped";
> + probe-type = "CFI";
> + reg = <fe000000 01000000>;
> + bank-width = <1>;
> + partitions = <00000000 01000000>;
> + partition-names = "data0";
> + };
> +
> + flash@ff000000 {
> + device_type = "rom";
> + compatible = "direct-mapped";
> + probe-type = "CFI";
> + reg = <ff000000 01000000>;
> + bank-width = <1>;
> + partitions = <00000000 00f00000
> + 00f00000 00100000>;
> + partition-names = "data1", "u-boot";
> + };
> };
> };
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] lite5200b: flash definition in dts
2007-08-01 12:41 ` Grant Likely
@ 2007-08-02 5:58 ` Domen Puncer
2007-08-02 6:23 ` Grant Likely
0 siblings, 1 reply; 7+ messages in thread
From: Domen Puncer @ 2007-08-02 5:58 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-embedded
On 01/08/07 06:41 -0600, Grant Likely wrote:
> On 8/1/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> > Add flash definition for to lite5200b dts, and while at it
> > fix "ranges" for soc node.
> >
...
> > +++ work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
> > @@ -52,7 +52,8 @@
> > revision = ""; // from bootloader
> > #interrupt-cells = <3>;
> > device_type = "soc";
> > - ranges = <0 f0000000 f0010000>;
> > + ranges = <00000000 f0000000 00010000
> > + fe000000 fe000000 02000000>;
>
> I don't think this is the right approach. I think the SoC node is
> intended for describing the on-chip devices, and the ranges property
> reflects that. Shouldn't flash nodes be up 1 level?
>
That would make sense, however, it does not work, probably because:
arch/powerpc/kernel/of_platform.c:
32 /*
33 * The list of OF IDs below is used for matching bus types in the
34 * system whose devices are to be exposed as of_platform_devices.
35 *
36 * This is the default list valid for most platforms. This file provides
37 * functions who can take an explicit list if necessary though
38 *
39 * The search is always performed recursively looking for children of
40 * the provided device_node and recursively if such a children matches
41 * a bus type in the list
42 */
43
44 static struct of_device_id of_default_bus_ids[] = {
45 { .type = "soc", },
46 { .compatible = "soc", },
47 { .type = "spider", },
48 { .type = "axon", },
49 { .type = "plb5", },
50 { .type = "plb4", },
51 { .type = "opb", },
52 { .type = "ebc", },
53 {},
54 };
Suggestions?
BTW. phy's are also not on chip, but are usualy listed under "soc"
(ie. mpc885ads.dts). Or rtc chip connected to i2c in kuroboxHD.dts.
Domen
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] lite5200b: flash definition in dts
2007-08-02 5:58 ` Domen Puncer
@ 2007-08-02 6:23 ` Grant Likely
2007-08-02 16:56 ` Scott Wood
2007-08-07 7:02 ` [PATCH v2] " Domen Puncer
0 siblings, 2 replies; 7+ messages in thread
From: Grant Likely @ 2007-08-02 6:23 UTC (permalink / raw)
To: Domen Puncer; +Cc: linuxppc-embedded
On 8/1/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> On 01/08/07 06:41 -0600, Grant Likely wrote:
> > On 8/1/07, Domen Puncer <domen.puncer@telargo.com> wrote:
> > > Add flash definition for to lite5200b dts, and while at it
> > > fix "ranges" for soc node.
> > >
> ...
> > > +++ work-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
> > > @@ -52,7 +52,8 @@
> > > revision = ""; // from bootloader
> > > #interrupt-cells = <3>;
> > > device_type = "soc";
> > > - ranges = <0 f0000000 f0010000>;
> > > + ranges = <00000000 f0000000 00010000
> > > + fe000000 fe000000 02000000>;
> >
> > I don't think this is the right approach. I think the SoC node is
> > intended for describing the on-chip devices, and the ranges property
> > reflects that. Shouldn't flash nodes be up 1 level?
> >
>
> That would make sense, however, it does not work, probably because:
> arch/powerpc/kernel/of_platform.c:
> <snip>
>
> Suggestions?
This is fixable in many ways. I don't know if there is an established
convention yet, but it's just a matter of making sure the platform
setup code adds the devices to the of_platform_bus. Freescale folks,
what say you?
> BTW. phy's are also not on chip, but are usualy listed under "soc"
> (ie. mpc885ads.dts). Or rtc chip connected to i2c in kuroboxHD.dts.
Phy's are also directly connected to MDIO busses and rtc chips
directly connected to i2c busses. Both the MDIO and i2c controllers
are mapped entirely within the MBAR region which matches the soc node
range. Flash seems different to me because it is mapped outside the
shared region...
On the other hand there is PCI whose control registers fall within the
SoC range; but the memory windows absolutely do not. If my flash
argument holds water, then where does that leave PCI which kind of
straddles the fence. Gah. Perhaps I'm getting too wrapped up in
nothing. Having the flash node as a child of "soc" still describes
the platform in an unambiguous way.
Cheers,
g.
>
>
> Domen
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] lite5200b: flash definition in dts
2007-08-02 6:23 ` Grant Likely
@ 2007-08-02 16:56 ` Scott Wood
2007-08-07 7:02 ` [PATCH v2] " Domen Puncer
1 sibling, 0 replies; 7+ messages in thread
From: Scott Wood @ 2007-08-02 16:56 UTC (permalink / raw)
To: Grant Likely; +Cc: Domen Puncer, linuxppc-embedded
On Thu, Aug 02, 2007 at 12:23:31AM -0600, Grant Likely wrote:
> On the other hand there is PCI whose control registers fall within the
> SoC range; but the memory windows absolutely do not. If my flash
> argument holds water, then where does that leave PCI which kind of
> straddles the fence.
IMHO, PCI should be split into a bus node that sits outside the SoC, and
a control node that sits inside, with phandles between the two.
-Scott
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2] lite5200b: flash definition in dts
2007-08-02 6:23 ` Grant Likely
2007-08-02 16:56 ` Scott Wood
@ 2007-08-07 7:02 ` Domen Puncer
1 sibling, 0 replies; 7+ messages in thread
From: Domen Puncer @ 2007-08-07 7:02 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-embedded
Add flash definition for in lite5200b dts, and while at it
fix "ranges" for soc node.
Signed-off-by: Domen Puncer <domen.puncer@telargo.com>
---
OK.
Then how about something like this?
# ls /sys/devices/
total 0
drwxr-xr-x 34 root root 0 Dec 9 1993 f0000000.soc5200
drwxr-xr-x 3 root root 0 Dec 9 1993 fe000000.flash
drwxr-xr-x 3 root root 0 Dec 9 1993 ff000000.flash
drwxr-xr-x 4 root root 0 Dec 9 1993 pci0000:00
drwxr-xr-x 5 root root 0 Dec 9 1993 platform
drwxr-xr-x 6 root root 0 Aug 7 08:39 system
# cat /proc/mtd
dev: size erasesize name
mtd0: 01000000 00020000 "data0"
mtd1: 00f00000 00020000 "data1"
mtd2: 00100000 00020000 "u-boot"
Domen
arch/powerpc/boot/dts/lite5200b.dts | 23 ++++++++++++++++++++++-
arch/powerpc/platforms/52xx/mpc52xx_common.c | 15 +++++++++++++++
2 files changed, 37 insertions(+), 1 deletion(-)
Index: clean-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
===================================================================
--- clean-powerpc.git.orig/arch/powerpc/boot/dts/lite5200b.dts
+++ clean-powerpc.git/arch/powerpc/boot/dts/lite5200b.dts
@@ -52,7 +52,7 @@
revision = ""; // from bootloader
#interrupt-cells = <3>;
device_type = "soc";
- ranges = <0 f0000000 f0010000>;
+ ranges = <00000000 f0000000 00010000>;
reg = <f0000000 00010000>;
bus-frequency = <0>; // from bootloader
system-frequency = <0>; // from bootloader
@@ -345,4 +345,25 @@
reg = <8000 4000>;
};
};
+
+ flash@fe000000 {
+ device_type = "rom";
+ compatible = "direct-mapped";
+ probe-type = "CFI";
+ reg = <fe000000 01000000>;
+ bank-width = <1>;
+ partitions = <00000000 01000000>;
+ partition-names = "data0";
+ };
+
+ flash@ff000000 {
+ device_type = "rom";
+ compatible = "direct-mapped";
+ probe-type = "CFI";
+ reg = <ff000000 01000000>;
+ bank-width = <1>;
+ partitions = <00000000 00f00000
+ 00f00000 00100000>;
+ partition-names = "data1", "u-boot";
+ };
};
Index: clean-powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_common.c
===================================================================
--- clean-powerpc.git.orig/arch/powerpc/platforms/52xx/mpc52xx_common.c
+++ clean-powerpc.git/arch/powerpc/platforms/52xx/mpc52xx_common.c
@@ -119,9 +119,24 @@ unmap_regs:
void __init
mpc52xx_declare_of_platform_devices(void)
{
+ struct device_node *root, *child;
+ static const struct of_device_id matches[] = {
+ { .type = "rom", .compatible = "direct-mapped", },
+ {}
+ };
+
/* Find every child of the SOC node and add it to of_platform */
if (of_platform_bus_probe(NULL, NULL, NULL))
printk(KERN_ERR __FILE__ ": "
"Error while probing of_platform bus\n");
+
+ /* add flash chips */
+ root = of_find_node_by_path("/");
+ child = NULL;
+ while ((child = of_get_next_child(root, child))) {
+ if (of_match_node(matches, child))
+ of_platform_device_create(child, NULL, NULL);
+ }
+ of_node_put(root);
}
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2007-08-07 7:02 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-19 9:54 [PATCH] lite5200b: flash definition in dts Domen Puncer
2007-08-01 6:52 ` Domen Puncer
2007-08-01 12:41 ` Grant Likely
2007-08-02 5:58 ` Domen Puncer
2007-08-02 6:23 ` Grant Likely
2007-08-02 16:56 ` Scott Wood
2007-08-07 7:02 ` [PATCH v2] " Domen Puncer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).