Skip to contentSkip to conversation

cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

PATCH New Nikita V. Youshchenko 5 participants 8 messages Feb 25, 2008 – Mar 17, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

commit 0e6e4bbe5be1ef7f601abe7eddbe44b56fd5e43a

Author: Nikita Youshchenko <[email protected]>
Date:   Mon Feb 25 11:27:06 2008 +0000

cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

This patch splits mpc8260 fdt fixup code into individual file, fdt.c, and updates it up to what is in cpu/mpc83xx/fdt.c.

Also, it adds setting current-speed property for SMC uart, and setting value of 'brg-frequency' property on SOC node, if that property exists. The later is needed to support booting of vendor kernels based on 2.6.18 or near that.

cpu/mpc8260/Makefile +1 -1
index 80d7852..d2a9f79 100644
@@ -28,7 +28,7 @@ LIB	= $(obj)lib$(CPU).a
 START	= start.o kgdb.o
 COBJS	= traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
 	  interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \
-	  bedbug_603e.o pci.o spi.o
+	  bedbug_603e.o pci.o spi.o fdt.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
cpu/mpc8260/cpu.c +0 -18
index 55e61a1..f6383c3 100644
@@ -47,12 +47,6 @@
 #include <asm/processor.h>
 #include <asm/cpm_8260.h>
 
-#if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
-#include <libfdt_env.h>
-#include <fdt_support.h>
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_GET_CPU_STR_F)
@@ -298,15 +292,3 @@ void watchdog_reset (void)
 		enable_interrupts ();
 }
 #endif /* CONFIG_WATCHDOG */
-
-/* ------------------------------------------------------------------------- */
-#if defined(CONFIG_OF_LIBFDT)
-void ft_cpu_setup (void *blob, bd_t *bd)
-{
-	char * cpu_path = "/cpus/" OF_CPU;
-
-	do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
-	do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
-	do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
-}
-#endif /* CONFIG_OF_LIBFDT */
cpu/mpc8260/fdt.c new file +73 -0

73 lines not on this page · raw message

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20080225/3b672513/attachment.pgp

#1 lore raw

PATCH 1/1 cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

This is an updated version, that actually works.

commit 817027b43687a34d0c8e9880fcdea40a424ceb8d

Author: Nikita Youshchenko <[email protected]>
Date:   Mon Feb 25 11:27:06 2008 +0000

cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

This patch:
- splits mpc8260 fdt fixup code into individual file, fdt.c,
- adds some fixups from cpu/mpc83xx/fdt.c,
- adds additional fixups, under #ifdef CONFIG_OF_COMPAT, that assist booting older (e.g. 2.6.18-based) vendor kernels.

Since cpu/mpc8260/config.mk unconditionally defines CONFIG_CPM2, checks for that macro are ommitted in cpu/mpc8260/fdt.c

cpu/mpc8260/Makefile +1 -1
index 80d7852..d2a9f79 100644
@@ -28,7 +28,7 @@ LIB	= $(obj)lib$(CPU).a
 START	= start.o kgdb.o
 COBJS	= traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
 	  interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \
-	  bedbug_603e.o pci.o spi.o
+	  bedbug_603e.o pci.o spi.o fdt.o
 
 SRCS	:= $(START:.o=.S) $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
cpu/mpc8260/cpu.c +0 -18
index 55e61a1..f6383c3 100644
@@ -47,12 +47,6 @@
 #include <asm/processor.h>
 #include <asm/cpm_8260.h>
 
-#if defined(CONFIG_OF_LIBFDT)
-#include <libfdt.h>
-#include <libfdt_env.h>
-#include <fdt_support.h>
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 #if defined(CONFIG_GET_CPU_STR_F)
@@ -298,15 +292,3 @@ void watchdog_reset (void)
 		enable_interrupts ();
 }
 #endif /* CONFIG_WATCHDOG */
-
-/* ------------------------------------------------------------------------- */
-#if defined(CONFIG_OF_LIBFDT)
-void ft_cpu_setup (void *blob, bd_t *bd)
-{
-	char * cpu_path = "/cpus/" OF_CPU;
-
-	do_fixup_by_path_u32(blob, cpu_path, "bus-frequency", bd->bi_busfreq, 1);
-	do_fixup_by_path_u32(blob, cpu_path, "timebase-frequency", OF_TBCLK, 1);
-	do_fixup_by_path_u32(blob, cpu_path, "clock-frequency", bd->bi_intfreq, 1);
-}
-#endif /* CONFIG_OF_LIBFDT */
cpu/mpc8260/fdt.c new file +67 -0

67 lines not on this page · raw message

#2 lore raw

[U-Boot-Users] mpc83xx and multiple flash banks.

Hi All,

I am really almost at the end of my tether regarding a mpc8323 PPC chip and chip selects. I have 4 flash banks on the board (all identical strataflash on CS0->CS3) on boot the registers are configured.

If I set flash banks to 4 (include/configs/MPC8323XEMDS.H if I remember) uboot then identifies the first bank as 16MB.. but fails the next 3 banks. After some digging the README states that C0000000(?) and some other addresses are set up as PRELIM chip selects and the PPC local bus memory locations and windows are set AFTER the flash chip is detected. Unless I got it all wrong, this does not happen. Neither does it remap the Memory window after flash has been detected.

After setting the CFG_FLASH_BANKS_LIST { } and setting BR0/1, OR0/1 , BAR0/1 and AR0/1 registers it gets the QRY for the Strataflash, but then uboot catches a PPC trap and resets. After some mangling (setting Flash bank count to 1) and booting U-boot without an error... Bank0 responds as expected using the MD command (memory locations 0xfe000000 -> 0xfeffffff are all readable)

But the same commands on Flash bank 1 after the 2Megabyte barrier cause the PPC to trap.
0xf0000000 -> 0xf01fffff are all readable... but 1 byte over that and it PPC traps.

I have read and re-read the spec... but something is biting me. Can anyone throw me a bone to chase :P I am at a loss why the memory window is only getting to 2MB although I have set to beyond 16MB (LBLAWAR 0x80000018)
I have disables all other chip select code segments in the config file and only BR0/1 AR0/1 are being set. (all others are zero)

Anyone help me out?

Best Regards,
Richard

------------------------------------------------------------------------------
Cambridge Broadband Networks Limited

Registered in England and Wales under company number: 03879840
Registered office: Selwyn House, Cambridge Business Park, Cowley Road, Cambridge CB4 0WZ, UK. VAT number: GB 741 0186 64

This email and any attachments are private and confidential. If you believe you have received this email in error please inform the sender and delete it from your mailbox or any other storage mechanism. Cambridge Broadband Networks Limited cannot accept liability for any statements made which are clearly the individual sender's own and not expressly made on behalf of Cambridge Broadband Networks Limited.

#3 lore raw

PATCH 1/1 cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

In reply to Nikita V. Youshchenko

cpu/mpc8260/Makefile LIB = $(obj)lib$(CPU).a · line 31

Quoted 9 lines · In message <[email protected]> you wrote:
cpu/mpc8260/Makefile +1 -1
@@ -28,7 +28,7 @@ LIB	= $(obj)lib$(CPU).a
 START	= start.o kgdb.o
 COBJS	= traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
 	  interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \
-	  bedbug_603e.o pci.o spi.o
+	  bedbug_603e.o pci.o spi.o fdt.o

Maybe we could try and keep (or rather make, s far as possible) lists sorted.

Quoted 1 line
cpu/mpc8260/fdt.c +0 -0

...

cpu/mpc8260/fdt.c line 62

Quoted 4 lines
cpu/mpc8260/fdt.c +4 -0
+	do_fixup_by_compat_u32(blob, "fsl,cpm2-smc-uart",
+		"current-speed", bd->bi_baudrate, 1);
+	do_fixup_by_compat_u32(blob, "fsl,cpm2-scc-uart",
+		"current-speed", bd->bi_baudrate, 1);

I think it is wrong to set both the SMC and the SCC "current-speed" to the console baudrate. Only one port can be the current console, and only for this one the value is correct.

Actually I wonder how this is supposed to work at all, as there are two SMC and 4 SCC which all could be used as UART ports.

Isn't this calling for trouble?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The lesser of two evils -- is evil."             - Seymour (Sy) Leon
#4 lore raw

PATCH 1/1 cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

Quoted 12 lines

cpu/mpc8260/Makefile LIB = $(obj)lib$(CPU).a · line 31

Quoted 8 lines · In message <[email protected]> you wrote:
cpu/mpc8260/Makefile +1 -1
@@ -28,7 +28,7 @@ LIB	= $(obj)lib$(CPU).a
 START	= start.o kgdb.o
 COBJS	= traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
 	  interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \
-	  bedbug_603e.o pci.o spi.o
+	  bedbug_603e.o pci.o spi.o fdt.o

Maybe we could try and keep (or rather make, s far as possible) lists sorted.

Shouldn't list sorting go into separate patch?

Quoted 13 lines
Quoted 1 line
cpu/mpc8260/fdt.c +0 -0

...

cpu/mpc8260/fdt.c line 62

Quoted 4 lines
cpu/mpc8260/fdt.c +4 -0
+	do_fixup_by_compat_u32(blob, "fsl,cpm2-smc-uart",
+		"current-speed", bd->bi_baudrate, 1);
+	do_fixup_by_compat_u32(blob, "fsl,cpm2-scc-uart",
+		"current-speed", bd->bi_baudrate, 1);

I think it is wrong to set both the SMC and the SCC "current-speed" to the console baudrate. Only one port can be the current console, and only for this one the value is correct.

Quoted 4 lines

Actually I wonder how this is supposed to work at all, as there are two SMC and 4 SCC which all could be used as UART ports.

Isn't this calling for trouble?

I don't know.
The board I currently work with has a single serial port, wired to SMC1, and SCCs are not used there.
I don't have access to other hardware now to test.

Looks like 'current speed' is used only by kernel serial driver, and only to set default speed for console. Before openning any other serial port, user should set up speed anyway. And if SCC is used not for serial, then having 'current-speed' property on it is a no-op.
So I thought the setting current-speed property for all SMCs and SCCs is harmless.

Btw, current 83xx code does set 'current-speed' for all SCCs, by calling do_fixup_by_compat_u32(..., "fsl,cpm2-scc-uart", ...). So the only thing I added is the same for SMCs, because board I work with has console on SMC.

Is it better to call do_fixup_by_compat_u32() only for SCCs or SMCs based on CONFIG_CONS_ON_SCC / CONFIG_CONS_ON_SMC ?

Or to set only for single node, where the console actually is? But then probably same should be done for mpc83xx and other cpus?

Nikita

#5 lore raw

PATCH 1/1 cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

Quoted 13 lines · Nikita V. Youshchenko
Quoted 12 lines

cpu/mpc8260/Makefile LIB = $(obj)lib$(CPU).a · line 31

Quoted 8 lines · In message <[email protected]> you wrote:
cpu/mpc8260/Makefile +1 -1
@@ -28,7 +28,7 @@ LIB	= $(obj)lib$(CPU).a
 START	= start.o kgdb.o
 COBJS	= traps.o serial_smc.o serial_scc.o cpu.o cpu_init.o speed.o \
 	  interrupts.o ether_scc.o ether_fcc.o i2c.o commproc.o \
-	  bedbug_603e.o pci.o spi.o
+	  bedbug_603e.o pci.o spi.o fdt.o

Maybe we could try and keep (or rather make, s far as possible) lists sorted.

Quoted 1 line

Shouldn't list sorting go into separate patch?

Btw please split it on file for one line

Quoted 5 lines
Quoted 5 lines
Quoted 2 lines
cpu/mpc8260/fdt.c +0 -0

...

Best Regards,
J

#6 lore raw

PATCH 1/1 cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

In reply to Nikita V. Youshchenko
Quoted 6 lines · Nikita V. Youshchenko

commit 0e6e4bbe5be1ef7f601abe7eddbe44b56fd5e43a

Author: Nikita Youshchenko <[email protected]>
Date:   Mon Feb 25 11:27:06 2008 +0000

cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

Quoted 7 lines

This patch splits mpc8260 fdt fixup code into individual file, fdt.c, and updates it up to what is in cpu/mpc83xx/fdt.c.

Also, it adds setting current-speed property for SMC uart, and setting value of 'brg-frequency' property on SOC node, if that property exists. The later is needed to support booting of vendor kernels based on 2.6.18 or near that.

brg-frequency is deprecated. You should set the clock-frequency property in the brg node instead.

-Scott

#7 lore raw

PATCH 1/1 cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

Quoted 10 lines · Scott Wood
Quoted 9 lines · Nikita V. Youshchenko

commit 0e6e4bbe5be1ef7f601abe7eddbe44b56fd5e43a

Author: Nikita Youshchenko <[email protected]>
Date:   Mon Feb 25 11:27:06 2008 +0000

cpu/mpc8260/: ported new fdt code from cpu/mpc83xx/

This patch splits mpc8260 fdt fixup code into individual file, fdt.c, and updates it up to what is in cpu/mpc83xx/fdt.c.

Quoted 7 lines
Quoted 4 lines

Also, it adds setting current-speed property for SMC uart, and setting value of 'brg-frequency' property on SOC node, if that property exists. The later is needed to support booting of vendor kernels based on 2.6.18 or near that.

brg-frequency is deprecated. You should set the clock-frequency property in the brg node instead.

Never mind, I should have read the patch itself more closely. The commit message should be updated, though.

-Scott