powerpc: Partialy restore core of mpc8xx
Subsystems (2)
PATCH v5 1/1 powerpc: Partialy restore core of mpc8xx
CS Systemes d'Information (CSSI) manufactures 8xx boards for critical communication systems. Those boards have been running U-Boot since 2010 and will have to be maintained until at least 2027.
commit 5b8e76c35ec312a3f73126bd1a2d2c0965b98a9f ("powerpc, 8xx: remove support for 8xx") orphaned those boards by removing support for the mpc8xx CPU.
This commit partially restores support for the 8xx, with the following limitations:
- Restores support for MPC866 and MPC885 only
- Does not restore IDE, PCMCIA, I2C, USB
- Does not restore examples
- Does not restore POST
- Does not restore Ethernet on SCC
- Does not restore bedbug and kgdb support
As the 866 and 885 do not support the following features, they are not restored either:
- VIDEO / LCD
- RTC clock
The CPM uCODE patch is not restored either, because:
- 866 and 885 already have support for I2C and SPI relocation without a uCODE patch
- relocation of SMC, I2C or SPI is only needed for using SCCs for Ethernet or QMC
The dynamic setup/calculation of clocks is removed, we expect the target being use with the clock and PLPRCR register defined in the configuration.
All the clock settings for 8xx prior to 866 is removed as well as we now only support 866 and 885.
The following files are not restored by this patch:
- arch/powerpc/cpu/mpc8xx/bedbug_860.c
- arch/powerpc/cpu/mpc8xx/fec.h
- arch/powerpc/cpu/mpc8xx/kgdb.S
- arch/powerpc/cpu/mpc8xx/plprcr_write.S
- arch/powerpc/cpu/mpc8xx/scc.c
- arch/powerpc/cpu/mpc8xx/upatch.c
- arch/powerpc/cpu/mpc8xx/video.c
- arch/powerpc/include/asm/status_led.h
- arch/powerpc/lib/ide.c
- arch/powerpc/lib/ide.h
- doc/README.MPC866
- drivers/pcmcia/mpc8xx_pcmcia.c
- drivers/rtc/mpc8xx.c
- drivers/usb/gadget/mpc8xx_udc.c
- drivers/video/mpc8xx_lcd.c
- examples/standalone/test_burst.c
- examples/standalone/test_burst.h
- examples/standalone/test_burst_lib.S
- examples/standalone/timer.c
- include/mpc823_lcd.h
- include/usb/mpc8xx_udc.h
- post/cpu/mpc8xx/Makefile
- post/cpu/mpc8xx/cache.c
- post/cpu/mpc8xx/cache_8xx.S
- post/cpu/mpc8xx/ether.c
- post/cpu/mpc8xx/spr.c
- post/cpu/mpc8xx/uart.c
- post/cpu/mpc8xx/usb.c
- post/cpu/mpc8xx/watchdog.c
Some of the restored files are not located in a proper location. In order to keep traceability of the changes, they will be moved to their correct location and moved to Kconfig in a followup patch.
This patch also declares CSSI as point of contact for the update of the 8xx platform, as those boards are the only ones still being maintained on the 8xx area. A later patch will add those boards to the tree.
---
Applies after the patch "powerpc: remove 4xx support" from Heiko
v5: Only restore the needed parts.
v4: Restored some common CONFIG_ removed by 5xx removal in README and config_whitelist
Removed all impacts on 4xx; Removed a few remaining references to 82xx Fixed unbalanced #ifdef in i2c
v3: Fixed build error in arch/powerpc/include/asm/ppc.h ; removed commproc.h from 4xx
v2: Tom squashed patches 1-10 of the serie
.travis.yml | 2 + MAINTAINERS | 2 +- README | 62 ++- api/api_platform-powerpc.c | 3 +- arch/powerpc/Kconfig | 6 + arch/powerpc/cpu/mpc8xx/Kconfig | 13 + arch/powerpc/cpu/mpc8xx/Makefile | 20 + arch/powerpc/cpu/mpc8xx/config.mk | 8 + arch/powerpc/cpu/mpc8xx/cpu.c | 354 +++++++++++++ arch/powerpc/cpu/mpc8xx/cpu_init.c | 180 +++++++ arch/powerpc/cpu/mpc8xx/fdt.c | 27 + arch/powerpc/cpu/mpc8xx/fec.c | 933 +++++++++++++++++++++++++++++++++ arch/powerpc/cpu/mpc8xx/interrupts.c | 278 ++++++++++ arch/powerpc/cpu/mpc8xx/serial.c | 564 ++++++++++++++++++++ arch/powerpc/cpu/mpc8xx/speed.c | 62 +++ arch/powerpc/cpu/mpc8xx/spi.c | 424 +++++++++++++++ arch/powerpc/cpu/mpc8xx/start.S | 645 +++++++++++++++++++++++ arch/powerpc/cpu/mpc8xx/traps.c | 187 +++++++ arch/powerpc/include/asm/8xx_immap.h | 468 +++++++++++++++++ arch/powerpc/include/asm/cache.h | 41 +- arch/powerpc/include/asm/global_data.h | 3 + arch/powerpc/include/asm/iopin_8xx.h | 379 +++++++++++++ arch/powerpc/include/asm/ppc.h | 11 + arch/powerpc/include/asm/processor.h | 5 +- arch/powerpc/lib/Kconfig | 8 + arch/powerpc/lib/Makefile | 1 + arch/powerpc/lib/immap.c | 564 ++++++++++++++++++++ arch/powerpc/lib/time.c | 11 + cmd/bdinfo.c | 3 +- cmd/reginfo.c | 59 ++- include/asm-generic/u-boot.h | 3 +- include/commproc.h | 687 ++++++++++++++++++++++++ include/mpc8xx.h | 14 - include/ppc_asm.tmpl | 46 ++ include/watchdog.h | 5 + scripts/config_whitelist.txt | 33 +- 36 files changed, 6072 insertions(+), 39 deletions(-) create mode 100644 arch/powerpc/cpu/mpc8xx/Kconfig create mode 100644 arch/powerpc/cpu/mpc8xx/Makefile create mode 100644 arch/powerpc/cpu/mpc8xx/config.mk create mode 100644 arch/powerpc/cpu/mpc8xx/cpu.c create mode 100644 arch/powerpc/cpu/mpc8xx/cpu_init.c create mode 100644 arch/powerpc/cpu/mpc8xx/fdt.c create mode 100644 arch/powerpc/cpu/mpc8xx/fec.c create mode 100644 arch/powerpc/cpu/mpc8xx/interrupts.c create mode 100644 arch/powerpc/cpu/mpc8xx/serial.c create mode 100644 arch/powerpc/cpu/mpc8xx/speed.c create mode 100644 arch/powerpc/cpu/mpc8xx/spi.c create mode 100644 arch/powerpc/cpu/mpc8xx/start.S create mode 100644 arch/powerpc/cpu/mpc8xx/traps.c create mode 100644 arch/powerpc/include/asm/8xx_immap.h create mode 100644 arch/powerpc/include/asm/iopin_8xx.h create mode 100644 arch/powerpc/lib/Kconfig create mode 100644 arch/powerpc/lib/immap.c create mode 100644 include/commproc.h
.travis.yml +2 -0
@@ -210,6 +210,8 @@ matrix: - env: - BUILDMAN="mpc86xx" - env: + - BUILDMAN="mpc8xx" + - env: - BUILDMAN="siemens" - env: - BUILDMAN="tegra"
MAINTAINERS +1 -1
@@ -324,7 +324,7 @@ S: Maintained F: arch/powerpc/ POWERPC MPC8XX -M: Wolfgang Denk <[email protected]> +M: Christophe Leroy <[email protected]> S: Maintained T: git git://git.denx.de/u-boot-mpc8xx.git F: arch/powerpc/cpu/mpc8xx/
README +57 -5
120 lines not on this page · raw message
api/api_platform-powerpc.c +2 -1
@@ -30,7 +30,8 @@ int platform_sys_info(struct sys_info *si) si->clk_bus = gd->bus_clk; si->clk_cpu = gd->cpu_clk; -#if defined(CONFIG_E500 ) || defined(CONFIG_MPC86xx) +#if defined(CONFIG_8xx) || \ + defined(CONFIG_E500 ) || defined(CONFIG_MPC86xx)#define bi_bar bi_immr_base#elif defined(CONFIG_MPC83xx)#define bi_bar bi_immrbar
arch/powerpc/Kconfig +6 -0
@@ -29,10 +29,16 @@ config MPC86xx select SYS_FSL_DDR select SYS_FSL_DDR_BE +config 8xx + bool "MPC8xx" + endchoice +source "arch/powerpc/lib/Kconfig" + source "arch/powerpc/cpu/mpc83xx/Kconfig" source "arch/powerpc/cpu/mpc85xx/Kconfig" source "arch/powerpc/cpu/mpc86xx/Kconfig" +source "arch/powerpc/cpu/mpc8xx/Kconfig" endmenu
arch/powerpc/cpu/mpc8xx/Kconfig new file +13 -0
@@ -0,0 +1,13 @@ +menu "mpc8xx CPU" + depends on 8xx + +config SYS_CPU + default "mpc8xx" + +choice + prompt "Target select" + optional + +endchoice + +endmenu
arch/powerpc/cpu/mpc8xx/Makefile new file +20 -0
@@ -0,0 +1,20 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +# ccflags-y += -DET_DEBUG + +extra-y += start.o +extra-y += traps.o +obj-y += cpu.o +obj-y += cpu_init.o +obj-y += fec.o +obj-$(CONFIG_OF_LIBFDT) += fdt.o +obj-y += interrupts.o +obj-y += serial.o +obj-y += speed.o +obj-y += spi.o +obj-y += plprcr_write.o
arch/powerpc/cpu/mpc8xx/config.mk new file +8 -0
@@ -0,0 +1,8 @@ +# +# (C) Copyright 2000-2010 +# Wolfgang Denk, DENX Software Engineering, wd at denx.de. +# +# SPDX-License-Identifier: GPL-2.0+ +# + +PLATFORM_CPPFLAGS += -mstring -mcpu=860 -msoft-float
arch/powerpc/cpu/mpc8xx/cpu.c new file +354 -0
354 lines not on this page · raw message
arch/powerpc/cpu/mpc8xx/cpu_init.c new file +180 -0
180 lines not on this page · raw message
arch/powerpc/cpu/mpc8xx/fdt.c new file +27 -0
@@ -0,0 +1,27 @@ +/* +* Copyright 2008 (C) Bryan O'Donoghue +* +* Code copied & edited from Freescale mpc85xx stuff. +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#include <common.h> +#include <libfdt.h> +#include <fdt_support.h> + +DECLARE_GLOBAL_DATA_PTR ; + +void ft_cpu_setup (void *blob,bd_t *bd) +{ +do_fixup_by_prop_u32 (blob,"device_type" ,"cpu" ,4 , +"timebase-frequency" ,get_tbclk (),1 ); +do_fixup_by_prop_u32 (blob,"device_type" ,"cpu" ,4 , +"bus-frequency" , bd->bi_busfreq,1 ); +do_fixup_by_prop_u32 (blob,"device_type" ,"cpu" ,4 , +"clock-frequency" , bd->bi_intfreq,1 ); +do_fixup_by_compat_u32 (blob,"fsl,cpm-brg" ,"clock-frequency" , + gd->arch.brg_clk,1 ); + +fdt_fixup_memory (blob, (u64 )bd->bi_memstart, (u64 )bd->bi_memsize); +}
arch/powerpc/cpu/mpc8xx/fec.c new file +933 -0
933 lines not on this page · raw message
arch/powerpc/cpu/mpc8xx/interrupts.c new file +278 -0
278 lines not on this page · raw message
arch/powerpc/cpu/mpc8xx/serial.c new file +564 -0
564 lines not on this page · raw message
arch/powerpc/cpu/mpc8xx/speed.c new file +62 -0
62 lines not on this page · raw message
arch/powerpc/cpu/mpc8xx/spi.c new file +424 -0
400 lines not on this page · raw message
arch/powerpc/cpu/mpc8xx/start.S new file +645 -0
645 lines not on this page · raw message
arch/powerpc/cpu/mpc8xx/traps.c new file +187 -0
187 lines not on this page · raw message
arch/powerpc/include/asm/8xx_immap.h new file +468 -0
468 lines not on this page · raw message
arch/powerpc/include/asm/cache.h +40 -1
41 lines not on this page · raw message
arch/powerpc/include/asm/iopin_8xx.h new file +379 -0
379 lines not on this page · raw message
arch/powerpc/lib/immap.c new file +564 -0
564 lines not on this page · raw message
cmd/reginfo.c +57 -2
59 lines not on this page · raw message
include/commproc.h new file +687 -0
687 lines not on this page · raw message
include/ppc_asm.tmpl +46 -0
46 lines not on this page · raw message
The rest of this diff is not shown. View the raw message.
Signature · 1 line
2.12.0
Part of the diff is not shown here. View the raw message.
PATCH v5 1/1 powerpc: Partialy restore core of mpc8xx
Dear Christophe,
Quoted 3 lines · In message <[email protected]> you wrote:
This commit partially restores support for the 8xx, with the following limitations:
Hmm... may I ask what you use as reference for this patch? It appears I cannot apply it to curent mainline:
-> git-am -3 -i -u --whitespace=strip /tmp/share/patch Commit Body is:
--------------------------
powerpc: Partialy restore core of mpc8xx
CS Systemes d'Information (CSSI) manufactures 8xx boards for critical communication systems. Those boards have been
...
being maintained on the 8xx area. A later patch will add those boards to the tree.
--------------------------
Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: y
Applying: powerpc: Partialy restore core of mpc8xx
fatal: sha1 information is lacking or useless (README).
error: could not build fake ancestor
Patch failed at 0001 powerpc: Partialy restore core of mpc8xx The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am -i --continue". If you prefer to skip this patch, run "git am -i --skip" instead. To restore the original branch and stop patching, run "git am -i --abort".
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 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 If something is different, it's either better or worse, and usually both. - Larry Wall
PATCH v5 1/1 powerpc: Partialy restore core of mpc8xx
Wolfgang Denk <[email protected]> a écrit :
Quoted 22 lines
Dear Christophe,
Quoted 3 lines · In message <[email protected]> you wrote:
This commit partially restores support for the 8xx, with the following limitations:
Hmm... may I ask what you use as reference for this patch? It appears I cannot apply it to curent mainline:
-> git-am -3 -i -u --whitespace=strip
/tmp/share/patchCommit Body is:
--------------------------
powerpc: Partialy restore core of mpc8xxCS Systemes d'Information (CSSI) manufactures 8xx boards for critical communication systems. Those boards have been
...
being maintained on the 8xx area. A later patch will add those boards to the tree.Signed-off-by Christophe Leroy <[email protected]>
Quoted 12 lines
--------------------------
Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all: y
Applying: powerpc: Partialy restore core of mpc8xx
fatal: sha1 information is lacking or useless (README).
error: could not build fake ancestor
Patch failed at 0001 powerpc: Partialy restore core of mpc8xx The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem, run "git am -i --continue". If you prefer to skip this patch, run "git am -i --skip" instead. To restore the original branch and stop patching, run "git am -i --abort".
I did rebase it to the mainline a few minutes before sending it. Did you apply 4xx removal patch first ? I wrote it in the patch after the ---, it is the way we do it in Linux, maybe you do differently in uboot ?
Regards
Christophe
Quoted 12 lines
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
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 If something is different, it's either better or worse, and usually
both. - Larry Wall
PATCH v5 1/1 powerpc: Partialy restore core of mpc8xx
Dear Christophe,
Quoted 5 lines · In message <[email protected]>…
I did rebase it to the mainline a few minutes before sending it. Did you apply 4xx removal patch first ? I wrote it in the patch after the ---, it is the way we do it in Linux, maybe you do differently in uboot ?
I tried it on top of current mainline - commit ID 8d6040c
==> (HEAD -> master, origin/master, origin/HEAD)
8d6040c 2017-06-29 21:30:16 -0400 pico-imx7d: Remove bouncing email 7826669 2017-06-29 21:30:16 -0400 doc: restore doc/README.fsl-clk 626662e 2017-06-29 21:24:16 -0400 .travis.yml: All DENX boards are now under Aries
...
BTW: Heiko reported the same issue, so it seems to be not only me having this problem.
Best regards,
Wolfgang Denk
Signature · 4 lines
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk 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 "This isn't brain surgery; it's just television." - David Letterman
PATCH v5 1/1 powerpc: Partialy restore core of mpc8xx
Quoted 12 lines · Wolfgang Denk
Dear Christophe,
Quoted 5 lines · In message <[email protected]>…
I did rebase it to the mainline a few minutes before sending it. Did you apply 4xx removal patch first ? I wrote it in the patch after the ---, it is the way we do it in Linux, maybe you do differently in uboot ?
I tried it on top of current mainline - commit ID 8d6040c
==> (HEAD -> master, origin/master, origin/HEAD)
Quoted 8 lines
8d6040c 2017-06-29 21:30:16 -0400 pico-imx7d: Remove bouncing email 7826669 2017-06-29 21:30:16 -0400 doc: restore doc/README.fsl-clk 626662e 2017-06-29 21:24:16 -0400 .travis.yml: All DENX boards are now under Aries...
BTW: Heiko reported the same issue, so it seems to be not only me having this problem.
Yes, and Christophe said that this patch is on top of the 4xx removal patches.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170630/f8b3d6c9/attachment.sig>
PATCH v5 1/1 powerpc: Partialy restore core of mpc8xx
Quoted 19 lines · Tom Rini
Quoted 18 lines · Wolfgang Denk
Dear Christophe,
Quoted 5 lines · In message <[email protected]>…
I did rebase it to the mainline a few minutes before sending it. Did you apply 4xx removal patch first ? I wrote it in the patch after the ---, it is the way we do it in Linux, maybe you do differently in uboot ?
I tried it on top of current mainline - commit ID 8d6040c
==> (HEAD -> master, origin/master, origin/HEAD)
8d6040c 2017-06-29 21:30:16 -0400 pico-imx7d: Remove bouncing email 7826669 2017-06-29 21:30:16 -0400 doc: restore doc/README.fsl-clk 626662e 2017-06-29 21:24:16 -0400 .travis.yml: All DENX boards are now under Aries...
Quoted 6 lines
Quoted 2 lines
BTW: Heiko reported the same issue, so it seems to be not only me having this problem.
Yes, and Christophe said that this patch is on top of the 4xx removal patches.
v5 conflicts with commit 1f54a47ca1720a9b50a4ea59f263fc95eb1f89ea ("scripts: config_whitelist: Handle lines with leading spaces/tabs")
I'll send a v6 during the week
Christophe
PATCH v5 1/1 powerpc: Partialy restore core of mpc8xx
In reply to Christophe LeroyDear Christophe,
Quoted 3 lines · In message <[email protected]> you wrote:
This commit partially restores support for the 8xx, with the following limitations:
checkpatch complains about this patch like this:
total: 97 errors, 714 warnings, 87 checks, 6380 lines checked
I am fully aware that this is not your fault, it is the old code you are bringing back. It is the reason we wanted to get rid of that code rather now than later.
I have one question which is a pure matter of concience: Do you accept it as your task as (potential) new maintainer of this code to make sure these issues will have to get fixed within a reasonable time frame?
What is your schedule? I would like to have a commitment from you so we are able to decide if the needed cleanup actually gets done.
Thanks.
PATCH v5 1/1 powerpc: Partialy restore core of mpc8xx
Quoted 11 lines · Wolfgang Denk
Dear Christophe,
Quoted 3 lines · In message <[email protected]> you wrote:
This commit partially restores support for the 8xx, with the following limitations:
checkpatch complains about this patch like this:
total: 97 errors, 714 warnings, 87 checks, 6380 lines checked
Quoted 8 lines
I am fully aware that this is not your fault, it is the old code you are bringing back. It is the reason we wanted to get rid of that code rather now than later.
I have one question which is a pure matter of concience: Do you accept it as your task as (potential) new maintainer of this code to make sure these issues will have to get fixed within a reasonable time frame?
Yes I do.
Quoted 3 lines
What is your schedule? I would like to have a commitment from you so we are able to decide if the needed cleanup actually gets done.
I plan to address the 'errors' durign this week or early next week.
I'll then handle the 'warnings' and 'checks' incrementaly, during August.
Christophe
Quoted 3 lines
Thanks.