PULL REQUEST (for "next"): please pull u-boot-mpc5xxx
Subsystems (3)
The following changes since commit 67c7189dd35cb368ef665126fd17816581bd2e92:
Renato Andreola (1):
nios2: Added support to YANU UART
are available in the git repository at:
git://git.denx.de/u-boot-mpc5xxx.git master
Anatolij Gustschin (4):
mpc512x: make MEM IO Control configuration a board config option
mpc512x: add multi serial PSC support
mpc5121: add PSC serial communication routines
mpc5121: add common post_word_load/store code
common/serial.c | 23 +++ cpu/mpc512x/Makefile | 1 + cpu/mpc512x/commproc.c | 25 +++ cpu/mpc512x/fixed_sdram.c | 2 +- cpu/mpc512x/serial.c | 353 ++++++++++++++++++++++++++++++++++++++---- include/asm-ppc/immap_512x.h | 112 +++++++------- include/configs/aria.h | 2 + include/configs/mecp5123.h | 2 + include/configs/mpc5121ads.h | 2 + include/serial.h | 15 ++ 10 files changed, 451 insertions(+), 86 deletions(-) create mode 100644 cpu/mpc512x/commproc.c
Wolfgang Denk
AppliedQuoted 14 lines · In message <[email protected]> you wrote:
The following changes since commit
67c7189dd35cb368ef665126fd17816581bd2e92:
Renato Andreola (1):
nios2: Added support to YANU UARTare available in the git repository at:
git://git.denx.de/u-boot-mpc5xxx.gitmasterAnatolij Gustschin (4):
mpc512x: make MEM IO Control configuration a board config option
mpc512x: add multi serial PSC support
mpc5121: add PSC serial communication routines
mpc5121: add common post_word_load/store code
Quoted 12 lines
common/serial.c | 23 +++ cpu/mpc512x/Makefile | 1 + cpu/mpc512x/commproc.c | 25 +++ cpu/mpc512x/fixed_sdram.c | 2 +- cpu/mpc512x/serial.c | 353 ++++++++++++++++++++++++++++++++++++++---- include/asm-ppc/immap_512x.h | 112 +++++++------- include/configs/aria.h | 2 + include/configs/mecp5123.h | 2 + include/configs/mpc5121ads.h | 2 + include/serial.h | 15 ++ 10 files changed, 451 insertions(+), 86 deletions(-) create mode 100644 cpu/mpc512x/commproc.c
Applied.
Best regards,
Wolfgang Denk
Signature · 6 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 Another war ... must it always be so? How many comrades have we lost in this way? ... Obedience. Duty. Death, and more death ... -- Romulan Commander, "Balance of Terror", stardate 1709.2
Dear Anatolij,
Quoted 28 lines · In message <[email protected]> you wrote:
Quoted 14 lines · In message <[email protected]> you wrote:
The following changes since commit
67c7189dd35cb368ef665126fd17816581bd2e92:
Renato Andreola (1):
nios2: Added support to YANU UARTare available in the git repository at:
git://git.denx.de/u-boot-mpc5xxx.gitmasterAnatolij Gustschin (4):
mpc512x: make MEM IO Control configuration a board config option
mpc512x: add multi serial PSC support
mpc5121: add PSC serial communication routines
mpc5121: add common post_word_load/store codeQuoted 12 lines
common/serial.c | 23 +++ cpu/mpc512x/Makefile | 1 + cpu/mpc512x/commproc.c | 25 +++ cpu/mpc512x/fixed_sdram.c | 2 +- cpu/mpc512x/serial.c | 353 ++++++++++++++++++++++++++++++++++++++---- include/asm-ppc/immap_512x.h | 112 +++++++------- include/configs/aria.h | 2 + include/configs/mecp5123.h | 2 + include/configs/mpc5121ads.h | 2 + include/serial.h | 15 ++ 10 files changed, 451 insertions(+), 86 deletions(-) create mode 100644 cpu/mpc512x/commproc.c
Quoted 1 line
Applied.
And reverted again.
Your commit:
commit d774442c60756a8dd5d75de85574120ce375bd72 Author: Anatolij Gustschin <[email protected]> Date: Tue Mar 16 17:10:03 2010 +0100 mpc512x: add multi serial PSC support
breaks a large number of boards really hard because it adds a new entry (uninit()) to "struct serial_device" in "include/serial.h", without fixing all the places where such a struct gets initialized; this results in tons of warnings like these:
serial.c:321: warning: initialization from incompatible pointer type serial.c:321: warning: initialization from incompatible pointer type serial.c:321: warning: initialization from incompatible pointer type serial.c:321: warning: initialization from incompatible pointer type serial.c:324: warning: initialization from incompatible pointer type serial.c:324: warning: initialization from incompatible pointer type serial.c:324: warning: initialization from incompatible pointer type serial.c:324: warning: initialization from incompatible pointer type serial.c:327: warning: initialization from incompatible pointer type serial.c:327: warning: initialization from incompatible pointer type serial.c:327: warning: initialization from incompatible pointer type serial.c:327: warning: initialization from incompatible pointer type serial.c:330: warning: initialization from incompatible pointer type serial.c:330: warning: initialization from incompatible pointer type serial.c:330: warning: initialization from incompatible pointer type serial.c:330: warning: initialization from incompatible pointer type
and (even worse) in bricking all these boards.
Please make sure to run MAKEALL when submitting patches!!!
[I'll leave this code as is in the u-boot-mpc5xxx repo for now, but I will rebase this as soon as you submit a fix.]
Best regards,
Wolfgang Denk
Signature · 5 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 "We Americans, we're a simple people... but piss us off, and we'll bomb your cities." - Robin Williams, _Good Morning Vietnam_
PATCH 1/1 serial: fix struct serial_device initialisation
Commit d774442c60756a8dd5d75de85574120ce375bd72 extended struct serial_device but didn't add appropriate initialization in all serial drivers. This results in bricking a huge number of boards.
This patch adds needed initialization in serial drivers.
---
This patch is based on u-boot-mpc5xxx master.
board/logicpd/zoom2/zoom2_serial.h | 1 + cpu/mpc5xxx/serial.c | 2 ++ cpu/mpc8xx/serial.c | 2 ++ cpu/ppc4xx/4xx_uart.c | 2 ++ drivers/serial/serial.c | 1 + drivers/serial/serial_pxa.c | 3 +++ drivers/serial/serial_s3c24x0.c | 1 + drivers/serial/serial_s5pc1xx.c | 1 + 8 files changed, 13 insertions(+), 0 deletions(-)
board/logicpd/zoom2/zoom2_serial.h +1 -0
@@ -65,6 +65,7 @@ struct serial_device zoom2_serial_device##n = \ N(n), \ U(n), \ quad_init_##n, \ + NULL, \ quad_setbrg_##n, \ quad_getc_##n, \ quad_tstc_##n, \
cpu/mpc5xxx/serial.c +2 -0
@@ -357,6 +357,7 @@ struct serial_device serial0_device ="serial0" ,"UART0" , serial0_init, +NULL , serial0_setbrg, serial0_getc, serial0_tstc,
@@ -369,6 +370,7 @@ struct serial_device serial1_device ="serial1" ,"UART1" , serial1_init, +NULL , serial1_setbrg, serial1_getc, serial1_tstc,
cpu/mpc8xx/serial.c +2 -0
@@ -392,6 +392,7 @@ struct serial_device serial_smc_device ="serial_smc" ,"SMC" , smc_init, +NULL , smc_setbrg, smc_getc, smc_tstc,
@@ -662,6 +663,7 @@ struct serial_device serial_scc_device ="serial_scc" ,"SCC" , scc_init, +NULL , scc_setbrg, scc_getc, scc_tstc,
cpu/ppc4xx/4xx_uart.c +2 -0
@@ -822,6 +822,7 @@ struct serial_device serial0_device ="serial0" ,"UART0" , serial0_init, +NULL , serial0_setbrg, serial0_getc, serial0_tstc,
@@ -834,6 +835,7 @@ struct serial_device serial1_device ="serial1" ,"UART1" , serial1_init, +NULL , serial1_setbrg, serial1_getc, serial1_tstc,
drivers/serial/serial.c +1 -0
@@ -115,6 +115,7 @@ static NS16550_t serial_ports[4] = { name,\ bus,\ eserial##port##_init,\ + NULL,\ eserial##port##_setbrg,\ eserial##port##_getc,\ eserial##port##_tstc,\
drivers/serial/serial_pxa.c +3 -0
@@ -266,6 +266,7 @@ struct serial_device serial_ffuart_device ="serial_ffuart" ,"PXA" , ffuart_init, +NULL , ffuart_setbrg, ffuart_getc, ffuart_tstc,
@@ -310,6 +311,7 @@ struct serial_device serial_btuart_device ="serial_btuart" ,"PXA" , btuart_init, +NULL , btuart_setbrg, btuart_getc, btuart_tstc,
@@ -354,6 +356,7 @@ struct serial_device serial_stuart_device ="serial_stuart" ,"PXA" , stuart_init, +NULL , stuart_setbrg, stuart_getc, stuart_tstc,
drivers/serial/serial_s3c24x0.c +1 -0
@@ -78,6 +78,7 @@ DECLARE_GLOBAL_DATA_PTR; name, \ bus, \ s3serial##port##_init, \ + NULL,\ s3serial##port##_setbrg, \ s3serial##port##_getc, \ s3serial##port##_tstc, \
drivers/serial/serial_s5pc1xx.c +1 -0
@@ -185,6 +185,7 @@ void s5p_serial##port##_puts(const char *s) { serial_puts_dev(s, port); } name, \ bus, \ s5p_serial##port##_init, \ + NULL, \ s5p_serial##port##_setbrg, \ s5p_serial##port##_getc, \ s5p_serial##port##_tstc, \
Signature · 1 line
1.6.3.3
PATCH 1/1 serial: fix struct serial_device initialisation
Quoted 5 lines · On Tue, 13 Apr 2010 16:31:35 +0200 Anatolij Gustschin <[email protected]> wrote:
Commit
d774442c60756a8dd5d75de85574120ce375bd72extended structserial_devicebut didn't add appropriate initialization in all serial drivers. This results in bricking a huge number of boards.
Quoted 7 lines
This patch adds needed initialization in serial drivers.
Reported-by Wolfgang Denk <[email protected]>Signed-off-by Anatolij Gustschin <[email protected]>---
This patch is based on u-boot-mpc5xxx master.
Please ignore this patch, it is outdated and now replaced by
[PATCH v4 1/8] serial: struct serial_device: add uninit() entry for drivers
Thanks,
Anatolij
Hello Wolfgang,
Quoted 65 lines · On Sun, 21 Mar 2010 23:34:44 +0100 Wolfgang Denk <[email protected]> wrote:
Dear Anatolij,
Quoted 28 lines · In message <[email protected]> you wrote:
Quoted 14 lines · In message <[email protected]> you wrote:
The following changes since commit
67c7189dd35cb368ef665126fd17816581bd2e92:
Renato Andreola (1):
nios2: Added support to YANU UARTare available in the git repository at:
git://git.denx.de/u-boot-mpc5xxx.gitmasterAnatolij Gustschin (4):
mpc512x: make MEM IO Control configuration a board config option
mpc512x: add multi serial PSC support
mpc5121: add PSC serial communication routines
mpc5121: add common post_word_load/store codeQuoted 12 lines
common/serial.c | 23 +++ cpu/mpc512x/Makefile | 1 + cpu/mpc512x/commproc.c | 25 +++ cpu/mpc512x/fixed_sdram.c | 2 +- cpu/mpc512x/serial.c | 353 ++++++++++++++++++++++++++++++++++++++---- include/asm-ppc/immap_512x.h | 112 +++++++------- include/configs/aria.h | 2 + include/configs/mecp5123.h | 2 + include/configs/mpc5121ads.h | 2 + include/serial.h | 15 ++ 10 files changed, 451 insertions(+), 86 deletions(-) create mode 100644 cpu/mpc512x/commproc.cQuoted 1 line
Applied.
And reverted again.
Your commit:
commit d774442c60756a8dd5d75de85574120ce375bd72 Author: Anatolij Gustschin <[email protected]> Date: Tue Mar 16 17:10:03 2010 +0100 mpc512x: add multi serial PSC supportbreaks a large number of boards really hard because it adds a new entry (
uninit()) to "structserial_device" in "include/serial.h", without fixing all the places where such a struct gets initialized; this results in tons of warnings like these:serial.c:321: warning: initialization from incompatible pointer type serial.c:321: warning: initialization from incompatible pointer type serial.c:321: warning: initialization from incompatible pointer type serial.c:321: warning: initialization from incompatible pointer type serial.c:324: warning: initialization from incompatible pointer type serial.c:324: warning: initialization from incompatible pointer type serial.c:324: warning: initialization from incompatible pointer type serial.c:324: warning: initialization from incompatible pointer type serial.c:327: warning: initialization from incompatible pointer type serial.c:327: warning: initialization from incompatible pointer type serial.c:327: warning: initialization from incompatible pointer type serial.c:327: warning: initialization from incompatible pointer type serial.c:330: warning: initialization from incompatible pointer type serial.c:330: warning: initialization from incompatible pointer type serial.c:330: warning: initialization from incompatible pointer type serial.c:330: warning: initialization from incompatible pointer type
Quoted 4 lines
and (even worse) in bricking all these boards.
Please make sure to run MAKEALL when submitting patches!!!
I'm sorry for this.
Quoted 2 lines
[I'll leave this code as is in the u-boot-mpc5xxx repo for now, but I will rebase this as soon as you submit a fix.]
What would be the best way to proceed here? I submitted separate patch to fix this, "serial: fix struct serial_device initialisation". It is based on u-boot-mpc5xxx repo. But since the directory structure has been changed now I think that better would be to revert these four patches in the u-boot-mpc5xxx repo. I can submit rebased patches which also address this breakage. I also noticed that adding post_word_load/store to cpu/mpc512x/commproc.c as one patch does, is actually wrong. So I need to address this, too.
Best regards,
Anatolij
Dear Anatolij,
Quoted 4 lines · In message <20100423102809.5afa8f3e@wker> you wrote:
Quoted 3 lines
[I'll leave this code as is in the u-boot-mpc5xxx repo for now, but I will rebase this as soon as you submit a fix.]
Quoted 8 lines
What would be the best way to proceed here? I submitted separate patch to fix this, "serial: fix struct
serial_deviceinitialisation". It is based on u-boot-mpc5xxx repo. But since the directory structure has been changed now I think that better would be to revert these four patches in the u-boot-mpc5xxx repo. I can submit rebased patches which also address this breakage. I also noticed that adding post_word_load/store tocpu/mpc512x/commproc.cas one patch does, is actually wrong. So I need to address this, too.
I would appreciate if you could submit rebased (against current master branch) patches. Thanks in advance.
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 Save yourself! Reboot in 5 seconds!
v4 cover Add support for PDM360NG board
These are reworked/rebased patches for PDM360NG board support. I expect them to be applied to u-boot-mpc5xxx branch (after removing four already applied patches from earlier version in the u-boot-mpc5xxx tree).
Changes since previous v3 are described in each
affected patch. First patch is new in this v4
series.
Anatolij Gustschin (8):
serial: struct serial_device: add uninit() entry for drivers
mpc512x: add multi serial PSC support
mpc5121: add PSC serial communication routines
mpc512x: make MEM IO Control configuration a board config option
mpc5121: determine RAM size using get_ram_size()
mpc5121: add support for PDM360NG board
mpc5121: add common post_word_load/store code
mpc5121: pdm360ng: add coprocessor POST
MAINTAINERS | 4 + MAKEALL | 1 + Makefile | 3 + arch/powerpc/cpu/mpc512x/Makefile | 1 + arch/powerpc/cpu/mpc512x/common.c | 25 ++ arch/powerpc/cpu/mpc512x/diu.c | 12 +- arch/powerpc/cpu/mpc512x/fixed_sdram.c | 9 +- arch/powerpc/cpu/mpc512x/serial.c | 353 ++++++++++++++++-- arch/powerpc/cpu/mpc5xxx/serial.c | 2 + arch/powerpc/cpu/mpc8xx/serial.c | 2 + arch/powerpc/cpu/ppc4xx/4xx_uart.c | 2 + arch/powerpc/include/asm/immap_512x.h | 117 +++--- board/freescale/common/fsl_diu_fb.c | 29 ++- board/logicpd/zoom2/zoom2_serial.h | 1 + board/pdm360ng/Makefile | 51 +++ board/pdm360ng/config.mk | 24 ++ board/pdm360ng/pdm360ng.c | 650 ++++++++++++++++++++++++++++++++ common/serial.c | 23 ++ drivers/serial/serial.c | 1 + drivers/serial/serial_pxa.c | 3 + drivers/serial/serial_s3c24x0.c | 1 + drivers/serial/serial_s5pc1xx.c | 1 + include/configs/aria.h | 3 + include/configs/mecp5123.h | 3 + include/configs/mpc5121-common.h | 53 +++ include/configs/mpc5121ads.h | 3 + include/configs/pdm360ng.h | 486 ++++++++++++++++++++++++ include/post.h | 1 + include/serial.h | 15 + post/board/pdm360ng/Makefile | 29 ++ post/board/pdm360ng/coproc_com.c | 97 +++++ post/tests.c | 13 + 32 files changed, 1925 insertions(+), 93 deletions(-) create mode 100644 arch/powerpc/cpu/mpc512x/common.c create mode 100644 board/pdm360ng/Makefile create mode 100644 board/pdm360ng/config.mk create mode 100644 board/pdm360ng/pdm360ng.c create mode 100644 include/configs/mpc5121-common.h create mode 100644 include/configs/pdm360ng.h create mode 100644 post/board/pdm360ng/Makefile create mode 100644 post/board/pdm360ng/coproc_com.c
PATCH v4 1/8 serial: struct serial_device: add uninit() entry for drivers
Subsequent patch extends mpc512x serial driver to support multiple PSC ports. The driver will provide an uninit() function to stop the serial controller and to disable the controller's clock. Adding uninit() entry to struct serial_device allows disabling the serial controller after usage of
a stdio serial device.
This patch adds uninit() entry to the struct serial_device and fixes initialization of this structure in the code accordingly.
--- arch/powerpc/cpu/mpc5xxx/serial.c | 2 ++ arch/powerpc/cpu/mpc8xx/serial.c | 2 ++ arch/powerpc/cpu/ppc4xx/4xx_uart.c | 2 ++ board/logicpd/zoom2/zoom2_serial.h | 1 + drivers/serial/serial.c | 1 + drivers/serial/serial_pxa.c | 3 +++ drivers/serial/serial_s3c24x0.c | 1 + drivers/serial/serial_s5pc1xx.c | 1 + include/serial.h | 1 + 9 files changed, 14 insertions(+), 0 deletions(-)
arch/powerpc/cpu/mpc5xxx/serial.c +2 -0
@@ -340,6 +340,7 @@ struct serial_device serial0_device ="serial0" ,"UART0" , serial0_init, +NULL , serial0_setbrg, serial0_getc, serial0_tstc,
@@ -352,6 +353,7 @@ struct serial_device serial1_device ="serial1" ,"UART1" , serial1_init, +NULL , serial1_setbrg, serial1_getc, serial1_tstc,
arch/powerpc/cpu/mpc8xx/serial.c +2 -0
@@ -392,6 +392,7 @@ struct serial_device serial_smc_device ="serial_smc" ,"SMC" , smc_init, +NULL , smc_setbrg, smc_getc, smc_tstc,
@@ -662,6 +663,7 @@ struct serial_device serial_scc_device ="serial_scc" ,"SCC" , scc_init, +NULL , scc_setbrg, scc_getc, scc_tstc,
arch/powerpc/cpu/ppc4xx/4xx_uart.c +2 -0
@@ -822,6 +822,7 @@ struct serial_device serial0_device ="serial0" ,"UART0" , serial0_init, +NULL , serial0_setbrg, serial0_getc, serial0_tstc,
@@ -834,6 +835,7 @@ struct serial_device serial1_device ="serial1" ,"UART1" , serial1_init, +NULL , serial1_setbrg, serial1_getc, serial1_tstc,
board/logicpd/zoom2/zoom2_serial.h +1 -0
@@ -65,6 +65,7 @@ struct serial_device zoom2_serial_device##n = \ N(n), \ U(n), \ quad_init_##n, \ + NULL, \ quad_setbrg_##n, \ quad_getc_##n, \ quad_tstc_##n, \
drivers/serial/serial.c +1 -0
@@ -115,6 +115,7 @@ static NS16550_t serial_ports[4] = { name,\ bus,\ eserial##port##_init,\ + NULL,\ eserial##port##_setbrg,\ eserial##port##_getc,\ eserial##port##_tstc,\
drivers/serial/serial_pxa.c +3 -0
@@ -266,6 +266,7 @@ struct serial_device serial_ffuart_device ="serial_ffuart" ,"PXA" , ffuart_init, +NULL , ffuart_setbrg, ffuart_getc, ffuart_tstc,
@@ -310,6 +311,7 @@ struct serial_device serial_btuart_device ="serial_btuart" ,"PXA" , btuart_init, +NULL , btuart_setbrg, btuart_getc, btuart_tstc,
@@ -354,6 +356,7 @@ struct serial_device serial_stuart_device ="serial_stuart" ,"PXA" , stuart_init, +NULL , stuart_setbrg, stuart_getc, stuart_tstc,
drivers/serial/serial_s3c24x0.c +1 -0
@@ -78,6 +78,7 @@ DECLARE_GLOBAL_DATA_PTR; name, \ bus, \ s3serial##port##_init, \ + NULL,\ s3serial##port##_setbrg, \ s3serial##port##_getc, \ s3serial##port##_tstc, \
drivers/serial/serial_s5pc1xx.c +1 -0
@@ -185,6 +185,7 @@ void s5p_serial##port##_puts(const char *s) { serial_puts_dev(s, port); } name, \ bus, \ s5p_serial##port##_init, \ + NULL, \ s5p_serial##port##_setbrg, \ s5p_serial##port##_getc, \ s5p_serial##port##_tstc, \
include/serial.h +1 -0
@@ -9,6 +9,7 @@ struct serial_device {char ctlr[CTLRSIZE ];int (*init) (void ); +int (*uninit) (void );void (*setbrg) (void );int (*getc) (void );int (*tstc) (void );
Signature · 1 line
1.6.3.3
PATCH v4 2/8 mpc512x: add multi serial PSC support
Extend mpc512x serial driver to support multiple PSC ports.
Subsequent patches for PDM360NG board support make use of this functionality by defining CONFIG_SERIAL_MULTI in the board config file. Additionally the used PSC devices are specified by defining e.g. CONFIG_SYS_PSC1, CONFIG_SYS_PSC4 and CONFIG_SYS_PSC6.
Support for PSC devices other than 1, 3, 4 and 6 is not added by this patch because these aren't used currently. In the future it can be easily added using DECLARE_PSC_SERIAL_FUNCTIONS(N) and INIT_PSC_SERIAL_STRUCTURE(N) macros in cpu/mpc512x/serial.c. Additionally you have to add code for registering added devices in serial_initialise() in common/serial.c.
---
v3 -> v4:
- rebased to apply on reworked directory structure
- moved addition of the uninit() entry in serial_device to the first patch of this new series
arch/powerpc/cpu/mpc512x/serial.c | 266 +++++++++++++++++++++++++++++---- arch/powerpc/include/asm/immap_512x.h | 108 +++++++------- common/serial.c | 23 +++ include/serial.h | 7 + 4 files changed, 323 insertions(+), 81 deletions(-)
arch/powerpc/cpu/mpc512x/serial.c +238 -28
@@ -32,14 +32,16 @@#include <common.h> #include <asm/io.h> #include <asm/processor.h> +#include <serial.h> DECLARE_GLOBAL_DATA_PTR ; -#if defined(CONFIG_PSC_CONSOLE ) +#if defined(CONFIG_PSC_CONSOLE ) || defined(CONFIG_SERIAL_MULTI )static void fifo_init (volatile psc512x_t *psc) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; +u32 tfsize, rfsize;/* reset Rx & Tx fifo slice */ out_be32 (&psc->rfcmd,PSC_FIFO_RESET_SLICE );
@@ -49,8 +51,65 @@ static void fifo_init (volatile psc512x_t *psc)out_be32 (&psc->rfintmask,0 );out_be32 (&psc->tfintmask,0 ); -out_be32 (&psc->tfsize,CONSOLE_FIFO_TX_SIZE | (CONSOLE_FIFO_TX_ADDR <<16 )); -out_be32 (&psc->rfsize,CONSOLE_FIFO_RX_SIZE | (CONSOLE_FIFO_RX_ADDR <<16 )); +#if defined(CONFIG_SERIAL_MULTI ) +switch (((u32 )psc &0xf00 ) >>8 ) { +case 0 : + tfsize =FIFOC_PSC0_TX_SIZE | (FIFOC_PSC0_TX_ADDR <<16 ); + rfsize =FIFOC_PSC0_RX_SIZE | (FIFOC_PSC0_RX_ADDR <<16 ); +break ; +case 1 : + tfsize =FIFOC_PSC1_TX_SIZE | (FIFOC_PSC1_TX_ADDR <<16 ); + rfsize =FIFOC_PSC1_RX_SIZE | (FIFOC_PSC1_RX_ADDR <<16 ); +break ; +case 2 : + tfsize =FIFOC_PSC2_TX_SIZE | (FIFOC_PSC2_TX_ADDR <<16 ); + rfsize =FIFOC_PSC2_RX_SIZE | (FIFOC_PSC2_RX_ADDR <<16 ); +break ; +case 3 : + tfsize =FIFOC_PSC3_TX_SIZE | (FIFOC_PSC3_TX_ADDR <<16 ); + rfsize =FIFOC_PSC3_RX_SIZE | (FIFOC_PSC3_RX_ADDR <<16 ); +break ; +case 4 : + tfsize =FIFOC_PSC4_TX_SIZE | (FIFOC_PSC4_TX_ADDR <<16 ); + rfsize =FIFOC_PSC4_RX_SIZE | (FIFOC_PSC4_RX_ADDR <<16 ); +break ; +case 5 : + tfsize =FIFOC_PSC5_TX_SIZE | (FIFOC_PSC5_TX_ADDR <<16 ); + rfsize =FIFOC_PSC5_RX_SIZE | (FIFOC_PSC5_RX_ADDR <<16 ); +break ; +case 6 : + tfsize =FIFOC_PSC6_TX_SIZE | (FIFOC_PSC6_TX_ADDR <<16 ); + rfsize =FIFOC_PSC6_RX_SIZE | (FIFOC_PSC6_RX_ADDR <<16 ); +break ; +case 7 : + tfsize =FIFOC_PSC7_TX_SIZE | (FIFOC_PSC7_TX_ADDR <<16 ); + rfsize =FIFOC_PSC7_RX_SIZE | (FIFOC_PSC7_RX_ADDR <<16 ); +break ; +case 8 : + tfsize =FIFOC_PSC8_TX_SIZE | (FIFOC_PSC8_TX_ADDR <<16 ); + rfsize =FIFOC_PSC8_RX_SIZE | (FIFOC_PSC8_RX_ADDR <<16 ); +break ; +case 9 : + tfsize =FIFOC_PSC9_TX_SIZE | (FIFOC_PSC9_TX_ADDR <<16 ); + rfsize =FIFOC_PSC9_RX_SIZE | (FIFOC_PSC9_RX_ADDR <<16 ); +break ; +case 10 : + tfsize =FIFOC_PSC10_TX_SIZE | (FIFOC_PSC10_TX_ADDR <<16 ); + rfsize =FIFOC_PSC10_RX_SIZE | (FIFOC_PSC10_RX_ADDR <<16 ); +break ; +case 11 : + tfsize =FIFOC_PSC11_TX_SIZE | (FIFOC_PSC11_TX_ADDR <<16 ); + rfsize =FIFOC_PSC11_RX_SIZE | (FIFOC_PSC11_RX_ADDR <<16 ); +break ; +default : +return ; + } +#else + tfsize =CONSOLE_FIFO_TX_SIZE | (CONSOLE_FIFO_TX_ADDR <<16 ); + rfsize =CONSOLE_FIFO_RX_SIZE | (CONSOLE_FIFO_RX_ADDR <<16 ); +#endif +out_be32 (&psc->tfsize, tfsize); +out_be32 (&psc->rfsize, rfsize);/* enable Tx & Rx FIFO slice */ out_be32 (&psc->rfcmd,PSC_FIFO_ENABLE_SLICE );
@@ -60,24 +119,47 @@ static void fifo_init (volatile psc512x_t *psc) __asm__volatile ("sync" ); } -void serial_setbrg (void ) +void serial_setbrg_dev (unsigned int idx) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE ]; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx];unsigned long baseclk, div; +unsigned long baudrate; +char buf[16 ]; +char *br_env; + + baudrate = gd->baudrate; +if (idx !=CONFIG_PSC_CONSOLE ) { +/* Allows setting baudrate for other serial devices +* on PSCx using environment. If not specified, use +* the same baudrate as for console. +*/ +sprintf (buf,"psc%d_baudrate" , idx); + br_env =getenv (buf); +if (br_env) + baudrate =simple_strtoul (br_env,NULL ,10 ); + +debug ("%s: idx %d, baudrate %d\n" , __func__, idx, baudrate); + } -/* calculate dividor for setting PSC CTUR and CTLR registers */ +/* calculate divisor for setting PSC CTUR and CTLR registers */ baseclk = (gd->ips_clk +8 ) /16 ; - div = (baseclk + (gd->baudrate /2 )) / gd->baudrate; + div = (baseclk + (baudrate /2 )) / baudrate;out_8 (&psc->ctur, (div >>8 ) &0xff );out_8 (&psc->ctlr, div &0xff );/* set baudrate */ } -int serial_init (void ) +int serial_init_dev (unsigned int idx) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE ]; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx]; +#if defined(CONFIG_SERIAL_MULTI ) +u32 reg; + + reg =in_be32 (&im->clk.sccr[0 ]); +out_be32 (&im->clk.sccr[0 ], reg |CLOCK_SCCR1_PSC_EN (idx)); +#endif fifo_init (psc);
@@ -100,7 +182,7 @@ int serial_init(void)out_8 (&psc->mode,PSC_MODE_1_STOPBIT );/* set baudrate */ -serial_setbrg (); +serial_setbrg_dev (idx);/* disable all interrupts */ out_be16 (&psc->psc_imr,0 );
@@ -113,13 +195,27 @@ int serial_init(void)return 0 ; } -void serial_putc (const char c) +int serial_uninit_dev (unsigned int idx) +{ +volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx]; +u32 reg; + +out_8 (&psc->command,PSC_RX_DISABLE |PSC_TX_DISABLE ); + reg =in_be32 (&im->clk.sccr[0 ]); + reg &= ~CLOCK_SCCR1_PSC_EN (idx); +out_be32 (&im->clk.sccr[0 ], reg); + +return 0 ; +} + +void serial_putc_dev (unsigned int idx,const char c) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE ]; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx];if (c =='\n' ) -serial_putc ('\r' ); +serial_putc_dev (idx,'\r' );/* Wait for last character to go. */ while (!(in_be16 (&psc->psc_status) &PSC_SR_TXEMP ))
@@ -128,10 +224,10 @@ void serial_putc (const char c)out_8 (&psc->tfdata_8, c); } -void serial_putc_raw (const char c) +void serial_putc_raw_dev (unsigned int idx,const char c) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE ]; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx];/* Wait for last character to go. */ while (!(in_be16 (&psc->psc_status) &PSC_SR_TXEMP ))
@@ -140,18 +236,16 @@ void serial_putc_raw (const char c)out_8 (&psc->tfdata_8, c); } - -void serial_puts (const char *s) +void serial_puts_dev (unsigned int idx,const char *s) { -while (*s) { -serial_putc (*s++); - } +while (*s) +serial_putc_dev (idx, *s++); } -int serial_getc (void ) +int serial_getc_dev (unsigned int idx) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE ]; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx];/* Wait for a character to arrive. */ while (in_be32 (&psc->rfstat) &PSC_FIFO_EMPTY )
@@ -160,18 +254,18 @@ int serial_getc (void)return in_8 (&psc->rfdata_8); } -int serial_tstc (void ) +int serial_tstc_dev (unsigned int idx) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE ]; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx];return !(in_be32 (&psc->rfstat) &PSC_FIFO_EMPTY ); } -void serial_setrts (int s) +void serial_setrts_dev (unsigned int idx,int s) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE ]; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx];if (s) {/* Assert RTS (become LOW) */
@@ -183,11 +277,127 @@ void serial_setrts(int s) } } -int serial_getcts (void ) +int serial_getcts_dev (unsigned int idx) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -volatile psc512x_t *psc = (psc512x_t *) &im->psc[CONFIG_PSC_CONSOLE ]; +volatile psc512x_t *psc = (psc512x_t *) &im->psc[idx];return (in_8 (&psc->ip) &0x1 ) ?0 :1 ; } +#endif /* CONFIG_PSC_CONSOLE || CONFIG_SERIAL_MULTI */ + +#if defined(CONFIG_SERIAL_MULTI ) + +#define DECLARE_PSC_SERIAL_FUNCTIONS (port) \ + int serial##port##_init(void) \ + { \ + return serial_init_dev(port); \ + } \ + int serial##port##_uninit(void) \ + { \ + return serial_uninit_dev(port); \ + } \ + void serial##port##_setbrg(void) \ + { \ + serial_setbrg_dev(port); \ + } \ + int serial##port##_getc(void) \ + { \ + return serial_getc_dev(port); \ + } \ + int serial##port##_tstc(void) \ + { \ + return serial_tstc_dev(port); \ + } \ + void serial##port##_putc(const char c) \ + { \ + serial_putc_dev(port, c); \ + } \ + void serial##port##_puts(const char *s) \ + { \ + serial_puts_dev(port, s); \ + } + +#define INIT_PSC_SERIAL_STRUCTURE (port, name, bus) { \ + name, \ + bus, \ + serial##port##_init, \ + serial##port##_uninit, \ + serial##port##_setbrg, \ + serial##port##_getc, \ + serial##port##_tstc, \ + serial##port##_putc, \ + serial##port##_puts, \ +} + +#if defined(CONFIG_SYS_PSC1 ) +DECLARE_PSC_SERIAL_FUNCTIONS (1 ); +struct serial_device serial1_device = +INIT_PSC_SERIAL_STRUCTURE (1 ,"psc1" ,"UART1" ); +#endif + +#if defined(CONFIG_SYS_PSC3 ) +DECLARE_PSC_SERIAL_FUNCTIONS (3 ); +struct serial_device serial3_device = +INIT_PSC_SERIAL_STRUCTURE (3 ,"psc3" ,"UART3" ); +#endif + +#if defined(CONFIG_SYS_PSC4 ) +DECLARE_PSC_SERIAL_FUNCTIONS (4 ); +struct serial_device serial4_device = +INIT_PSC_SERIAL_STRUCTURE (4 ,"psc4" ,"UART4" ); +#endif + +#if defined(CONFIG_SYS_PSC6 ) +DECLARE_PSC_SERIAL_FUNCTIONS (6 ); +struct serial_device serial6_device = +INIT_PSC_SERIAL_STRUCTURE (6 ,"psc6" ,"UART6" ); +#endif + +#else + +void serial_setbrg (void ) +{ +serial_setbrg_dev (CONFIG_PSC_CONSOLE ); +} + +int serial_init (void ) +{ +return serial_init_dev (CONFIG_PSC_CONSOLE ); +} + +void serial_putc (const char c) +{ +serial_putc_dev (CONFIG_PSC_CONSOLE , c); +} + +void serial_putc_raw (const char c) +{ +serial_putc_raw_dev (CONFIG_PSC_CONSOLE , c); +} + +void serial_puts (const char *s) +{ +serial_puts_dev (CONFIG_PSC_CONSOLE , s); +} + +int serial_getc (void ) +{ +return serial_getc_dev (CONFIG_PSC_CONSOLE ); +} + +int serial_tstc (void ) +{ +return serial_tstc_dev (CONFIG_PSC_CONSOLE ); +} + +void serial_setrts (int s) +{ +return serial_setrts_dev (CONFIG_PSC_CONSOLE , s); +} + +int serial_getcts (void ) +{ +return serial_getcts_dev (CONFIG_PSC_CONSOLE ); +}#endif /* CONFIG_PSC_CONSOLE */
arch/powerpc/include/asm/immap_512x.h +55 -53
121 lines not on this page · raw message
common/serial.c +23 -0
@@ -59,6 +59,14 @@ struct serial_device *__default_serial_console (void)#else return &serial0_device;#endif +#elif defined(CONFIG_MPC512X) +#if (CONFIG_PSC_CONSOLE ==3 ) +return &serial3_device; +#elif (CONFIG_PSC_CONSOLE ==6 ) +return &serial6_device; +#else +#error "Bad CONFIG_PSC_CONSOLE." +#endif #elif defined(CONFIG_S3C2410)#if defined(CONFIG_SERIAL1 )return &s3c24xx_serial0_device;
@@ -159,6 +167,20 @@ void serial_initialize (void)serial_register (&s5pc1xx_serial2_device);serial_register (&s5pc1xx_serial3_device);#endif +#if defined(CONFIG_MPC512X ) +#if defined(CONFIG_SYS_PSC1 ) +serial_register (&serial1_device); +#endif +#if defined(CONFIG_SYS_PSC3 ) +serial_register (&serial3_device); +#endif +#if defined(CONFIG_SYS_PSC4 ) +serial_register (&serial4_device); +#endif +#if defined(CONFIG_SYS_PSC6 ) +serial_register (&serial6_device); +#endif +#endif serial_assign (default_serial_console ()->name); }
@@ -174,6 +196,7 @@ void serial_stdio_init (void) dev.flags =DEV_FLAGS_OUTPUT |DEV_FLAGS_INPUT ; dev.start = s->init; + dev.stop = s->uninit; dev.putc = s->putc; dev.puts = s->puts; dev.getc = s->getc;
include/serial.h +7 -0
@@ -38,6 +38,13 @@ extern struct serial_device eserial4_device;#endif +#if defined(CONFIG_MPC512X ) +extern struct serial_device serial1_device; +extern struct serial_device serial3_device; +extern struct serial_device serial4_device; +extern struct serial_device serial6_device; +#endif +#if defined(CONFIG_S3C2410 )extern struct serial_device s3c24xx_serial0_device;extern struct serial_device s3c24xx_serial1_device;
Signature · 1 line
1.6.3.3
PATCH v4 3/8 mpc5121: add PSC serial communication routines
---
v3 -> v4:
- rebased to apply on reworked directory structure
arch/powerpc/cpu/mpc512x/serial.c | 87 +++++++++++++++++++++++++++++++++++++ include/serial.h | 7 +++ 2 files changed, 94 insertions(+), 0 deletions(-)
arch/powerpc/cpu/mpc512x/serial.c +87 -0
@@ -401,3 +401,90 @@ int serial_getcts(void)return serial_getcts_dev (CONFIG_PSC_CONSOLE ); }#endif /* CONFIG_PSC_CONSOLE */ + +#if defined(CONFIG_SERIAL_MULTI ) +#include <stdio_dev.h> +/* +* Routines for communication with serial devices over PSC +*/ +/* Bitfield for initialized PSCs */ +static unsigned int initialized; + +struct stdio_dev *open_port (int num,int baudrate) +{ +struct stdio_dev *port; +char env_var[16 ]; +char env_val[10 ]; +char name[7 ]; + +if (num <0 || num >11 ) +return NULL ; + +sprintf (name,"psc%d" , num); + port =stdio_get_by_name (name); +if (!port) +return NULL ; + +if (!test_bit (num, &initialized)) { +sprintf (env_var,"psc%d_baudrate" , num); +sprintf (env_val,"%d" , baudrate); +setenv (env_var, env_val); + +if (port->start ()) +return NULL ; + +set_bit (num, &initialized); + } + +return port; +} + +int close_port (int num) +{ +struct stdio_dev *port; +int ret; +char name[7 ]; + +if (num <0 || num >11 ) +return -1 ; + +sprintf (name,"psc%d" , num); + port =stdio_get_by_name (name); +if (!port) +return -1 ; + + ret = port->stop (); +clear_bit (num, &initialized); + +return ret; +} + +int write_port (struct stdio_dev *port,char *buf) +{ +if (!port || !buf) +return -1 ; + + port->puts (buf); + +return 0 ; +} + +int read_port (struct stdio_dev *port,char *buf,int size) +{ +int cnt =0 ; + +if (!port || !buf) +return -1 ; + +if (!size) +return 0 ; + +while (port->tstc ()) { + buf[cnt++] = port->getc (); +if (cnt > size) +break ; + } + +return cnt; +} +#endif /* CONFIG_SERIAL_MULTI */
include/serial.h +7 -0
@@ -92,4 +92,11 @@ extern int usbtty_tstc(void);#endif /* CONFIG_USB_TTY */ +#if defined(CONFIG_MPC512X ) && defined(CONFIG_SERIAL_MULTI ) +extern struct stdio_dev *open_port (int num,int baudrate); +extern int close_port (int num); +extern int write_port (struct stdio_dev *port,char *buf); +extern int read_port (struct stdio_dev *port,char *buf,int size); +#endif +#endif
Signature · 1 line
1.6.3.3
PATCH v4 4/8 mpc512x: make MEM IO Control configuration a board config option
---
v3 -> v4:
- rebased to apply on reworked directory structure
arch/powerpc/cpu/mpc512x/fixed_sdram.c | 2 +- arch/powerpc/include/asm/immap_512x.h | 4 ---- include/configs/aria.h | 2 ++ include/configs/mecp5123.h | 2 ++ include/configs/mpc5121ads.h | 2 ++ 5 files changed, 7 insertions(+), 5 deletions(-)
arch/powerpc/cpu/mpc512x/fixed_sdram.c +1 -1
@@ -91,7 +91,7 @@ long int fixed_sdram(ddr512x_config_t *mddrc_config, }/* Initialize IO Control */ -out_be32 (&im->io_ctrl.io_control_mem,IOCTRL_MUX_DDR ); +out_be32 (&im->io_ctrl.io_control_mem,CONFIG_SYS_IOCTRL_MUX_DDR );/* Initialize DDR Local Window */ out_be32 (&im->sysconf.ddrlaw.bar,CONFIG_SYS_DDR_BASE &0xFFFFF000 );
arch/powerpc/include/asm/immap_512x.h +0 -4
@@ -848,10 +848,6 @@ typedef struct ioctrl512x {u8 reserved[0x0cfc ];/* fill to 4096 bytes size */ } ioctrl512x_t; -/* Indexes in regs array */ -/* Set for DDR */ -#define IOCTRL_MUX_DDR 0x00000036 -/* IO pin fields */ #define IO_PIN_FMUX (v) ((v) << 7)/* pin function */ #define IO_PIN_HOLD (v) ((v) << 5)/* hold time, pci only */
include/configs/aria.h +2 -0
@@ -79,6 +79,8 @@#define CONFIG_SYS_DDR_BASE 0x00000000#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE +#define CONFIG_SYS_IOCTRL_MUX_DDR 0x00000036 +/* DDR Controller Configuration * * SYS_CFG:
include/configs/mecp5123.h +2 -0
@@ -67,6 +67,8 @@#define CONFIG_SYS_DDR_BASE 0x00000000/* DDR is sys memory*/ #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE +#define CONFIG_SYS_IOCTRL_MUX_DDR 0x00000036 +/* DDR Controller Configuration * * SYS_CFG:
include/configs/mpc5121ads.h +2 -0
@@ -86,6 +86,8 @@#define CONFIG_SYS_DDR_BASE 0x00000000/* DDR is system memory*/ #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE +#define CONFIG_SYS_IOCTRL_MUX_DDR 0x00000036 +/* DDR Controller Configuration * * SYS_CFG:
Signature · 1 line
1.6.3.3
PATCH v4 5/8 mpc5121: determine RAM size using get_ram_size()
Configure CONFIG_SYS_MAX_RAM_SIZE address range in DDR Local Access Window and determine the RAM size. Fix DDR LAW afterwards using detected RAM size.
---
v3 -> v4:
- rebased to apply on reworked directory structure
- use CONFIG_SYS_MAX_RAM_SIZE as upper limit while RAM auto-detection as suggested by Wolfgang
arch/powerpc/cpu/mpc512x/fixed_sdram.c | 7 ++++++- include/configs/aria.h | 1 + include/configs/mecp5123.h | 1 + include/configs/mpc5121ads.h | 1 + 4 files changed, 9 insertions(+), 1 deletions(-)
arch/powerpc/cpu/mpc512x/fixed_sdram.c +6 -1
@@ -78,7 +78,7 @@ long int fixed_sdram(ddr512x_config_t *mddrc_config, u32 *dram_init_seq, int seq_sz) {volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR ; -u32 msize =CONFIG_SYS_DDR_SIZE *1024 *1024 ; +u32 msize =CONFIG_SYS_MAX_RAM_SIZE ;u32 msize_log2 =__ilog2 (msize);u32 i;
@@ -148,5 +148,10 @@ long int fixed_sdram(ddr512x_config_t *mddrc_config,out_be32 (&im->mddrc.ddr_time_config0, mddrc_config->ddr_time_config0);out_be32 (&im->mddrc.ddr_sys_config, mddrc_config->ddr_sys_config); + msize =get_ram_size (CONFIG_SYS_DDR_BASE ,CONFIG_SYS_MAX_RAM_SIZE ); +/* Fix DDR Local Window for new size */ +out_be32 (&im->sysconf.ddrlaw.ar,__ilog2 (msize) -1 ); +sync_law (&im->sysconf.ddrlaw.ar); +return msize; }
include/configs/aria.h +1 -0
@@ -78,6 +78,7 @@#define CONFIG_SYS_DDR_SIZE 256/* MB */ #define CONFIG_SYS_DDR_BASE 0x00000000#define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE +#define CONFIG_SYS_MAX_RAM_SIZE 0x20000000#define CONFIG_SYS_IOCTRL_MUX_DDR 0x00000036
include/configs/mecp5123.h +1 -0
@@ -66,6 +66,7 @@#define CONFIG_SYS_DDR_BASE 0x00000000/* DDR is sys memory*/ #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE +#define CONFIG_SYS_MAX_RAM_SIZE 0x20000000#define CONFIG_SYS_IOCTRL_MUX_DDR 0x00000036
include/configs/mpc5121ads.h +1 -0
@@ -85,6 +85,7 @@#endif #define CONFIG_SYS_DDR_BASE 0x00000000/* DDR is system memory*/ #define CONFIG_SYS_SDRAM_BASE CONFIG_SYS_DDR_BASE +#define CONFIG_SYS_MAX_RAM_SIZE 0x20000000#define CONFIG_SYS_IOCTRL_MUX_DDR 0x00000036
Signature · 1 line
1.6.3.3
PATCH v4 6/8 mpc5121: add support for PDM360NG board
PDM360NG is a MPC5121E based board by ifm ecomatic gmbh.
---
v3 -> v4:
- rebased to apply on reworked directory structure
- drop CONFIG_PDM360NG_BIG define entirely and rework to rely on RAM auto-detection (as suggested by Wolfgang and Stefan)
- also auto-detect NOR Flash size and don't use CONFIG_PDM360NG_BIG for selection of NOR Flash configuration any more
- added code to fixup NOR Flash node and ranges property in the device tree using auto-detected flash size
MAINTAINERS | 4 + MAKEALL | 1 + Makefile | 3 + arch/powerpc/cpu/mpc512x/diu.c | 12 +- arch/powerpc/include/asm/immap_512x.h | 5 + board/freescale/common/fsl_diu_fb.c | 29 ++- board/pdm360ng/Makefile | 51 +++ board/pdm360ng/config.mk | 24 ++ board/pdm360ng/pdm360ng.c | 650 +++++++++++++++++++++++++++++++++ include/configs/mpc5121-common.h | 53 +++ include/configs/pdm360ng.h | 481 ++++++++++++++++++++++++ 11 files changed, 1307 insertions(+), 6 deletions(-) create mode 100644 board/pdm360ng/Makefile create mode 100644 board/pdm360ng/config.mk create mode 100644 board/pdm360ng/pdm360ng.c create mode 100644 include/configs/mpc5121-common.h create mode 100644 include/configs/pdm360ng.h
MAINTAINERS +4 -0
@@ -467,6 +467,10 @@ Josef Wagner <[email protected]> CPC45 MPC8245 PM520 MPC5200 +Michael Weiss <[email protected]> + + PDM360NG MPC5121e + Stephen Williams <[email protected]> JSE PPC405GPr
MAKEALL +1 -0
@@ -92,6 +92,7 @@ LIST_512x=" \ aria \ mecp5123 \ mpc5121ads \ + pdm360ng \ " #########################################################################
Makefile +3 -0
@@ -809,6 +809,9 @@ mpc5121ads_rev2_config \ fi @$(MKCONFIG) -a mpc5121ads powerpc mpc512x mpc5121ads freescale +pdm360ng_config: unconfig + @$(MKCONFIG) -a pdm360ng powerpc mpc512x pdm360ng + ######################################################################### ## MPC8xx Systems #########################################################################
arch/powerpc/cpu/mpc512x/diu.c +10 -2
@@ -34,6 +34,8 @@#include <video_fb.h> #endif +DECLARE_GLOBAL_DATA_PTR ; +#ifdef CONFIG_FSL_DIU_LOGO_BMP extern unsigned int FSL_Logo_BMP[];#else
@@ -65,10 +67,11 @@ void diu_set_pixel_clock(unsigned int pixclock)char *valid_bmp (char *addr) {unsigned long h_addr; +bd_t *bd = gd->bd; h_addr =simple_strtoul (addr,NULL ,16 ); -if (h_addr <CONFIG_SYS_FLASH_BASE || - h_addr >= (CONFIG_SYS_FLASH_BASE +CONFIG_SYS_FLASH_SIZE -1 )) { +if (h_addr < bd->bi_flashstart || + h_addr >= (bd->bi_flashstart + bd->bi_flashsize -1 )) {printf ("bmp addr %lx is not a valid flash address\n" , h_addr);return 0 ; }else if ((*(char *)(h_addr) !='B' ) || (*(char *)(h_addr+1 ) !='M' )) {
@@ -84,8 +87,13 @@ int mpc5121_diu_init(void)char *bmp =NULL ;char *bmp_env; +#if defined(CONFIG_VIDEO_XRES ) & defined(CONFIG_VIDEO_YRES ) + xres =CONFIG_VIDEO_XRES ; + yres =CONFIG_VIDEO_YRES ; +#else xres =1024 ; yres =768 ; +#endif pixel_format =0x88883316 ;debug ("mpc5121_diu_init\n" );
arch/powerpc/include/asm/immap_512x.h +5 -0
@@ -356,6 +356,11 @@ typedef struct ddr512x_config {u32 ddr_time_config2;/* Timing Configuration Register */ } ddr512x_config_t; +typedef struct sdram_conf_s { +unsigned long size; +ddr512x_config_t cfg; +}sdram_conf_t ; +/* * DMA/Messaging Unit */
board/freescale/common/fsl_diu_fb.c +25 -4
@@ -50,6 +50,22 @@ struct fb_videomode {#define FB_SYNC_COMP_HIGH_ACT 8/* composite sync high active */ #define FB_VMODE_NONINTERLACED 0/* non interlaced */ +/* This setting is used for the ifm pdm360ng with PRIMEVIEW PM070WL3 */ +static struct fb_videomode fsl_diu_mode_800 = { + .refresh =60 , + .xres =800 , + .yres =480 , + .pixclock =31250 , + .left_margin =86 , + .right_margin =42 , + .upper_margin =33 , + .lower_margin =10 , + .hsync_len =128 , + .vsync_len =2 , + .sync =0 , + .vmode =FB_VMODE_NONINTERLACED +}; +/* * These parameters give default parameters * for video output 1024x768,
@@ -210,9 +226,14 @@ int fsl_diu_init(int xres,disable_lcdc (); -if (xres ==1280 ) { +switch (xres) { +case 800 : + fsl_diu_mode_db = &fsl_diu_mode_800; +break ; +case 1280 : fsl_diu_mode_db = &fsl_diu_mode_1280; - }else { +break ; +default : fsl_diu_mode_db = &fsl_diu_mode_1024; }
@@ -519,9 +540,9 @@ int fsl_diu_display_bmp(unsigned char *bmp, b = *bitmap++;for (k =0 ; k <8 ; k++) {if (b &0x80 ) - *fb_t = palette[1 ]; + *fb_t++ = palette[1 ];else - *fb_t = palette[0 ]; + *fb_t++ = palette[0 ]; b = b <<1 ; } }
board/pdm360ng/Makefile new file +51 -0
51 lines not on this page · raw message
board/pdm360ng/config.mk new file +24 -0
@@ -0,0 +1,24 @@ +# +# (C) Copyright 2009 +# Michael Wei??, ifm ecomatic gmbh, michael.weiss at ifm.com +# +# See file CREDITS for list of people who contributed to this +# project. +# +# 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. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# + +TEXT_BASE = 0xF0000000
board/pdm360ng/pdm360ng.c new file +650 -0
650 lines not on this page · raw message
include/configs/mpc5121-common.h new file +53 -0
53 lines not on this page · raw message
include/configs/pdm360ng.h new file +481 -0
481 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH v4 7/8 mpc5121: add common post_word_load/store code
Add common post_word_load/post_word_store routines for all mpc5121 boards. pdm360ng board POST support added by subsequent patch needs them.
---
v3 -> v4:
- rebased to apply on reworked directory structure
- changed the file name from commproc.c to common.c
arch/powerpc/cpu/mpc512x/Makefile | 1 + arch/powerpc/cpu/mpc512x/common.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 arch/powerpc/cpu/mpc512x/common.c
arch/powerpc/cpu/mpc512x/Makefile +1 -0
@@ -29,6 +29,7 @@ LIB = $(obj)lib$(CPU).a START = start.o COBJS-y := cpu.o COBJS-y += traps.o +COBJS-y += common.o COBJS-y += cpu_init.o COBJS-y += fixed_sdram.o COBJS-y += i2c.o
arch/powerpc/cpu/mpc512x/common.c new file +25 -0
@@ -0,0 +1,25 @@ +#include <common.h> +#include <asm/io.h> + +#if defined(CONFIG_POST ) || defined(CONFIG_LOGBUFFER ) + +#if defined(CONFIG_SYS_POST_WORD_ADDR ) +# define _POST_ADDR (CONFIG_SYS_POST_WORD_ADDR) +#else +#error echo "No POST word address defined" +#endif + +void post_word_store (ulong a) +{ +volatile void *save_addr = (volatile void *)(_POST_ADDR); + +out_be32 (save_addr, a); +} + +ulong post_word_load (void ) +{ +volatile void *save_addr = (volatile void *)(_POST_ADDR); + +return in_be32 (save_addr); +} +#endif /* CONFIG_POST || CONFIG_LOGBUFFER */
Signature · 1 line
1.6.3.3
PATCH v4 8/8 mpc5121: pdm360ng: add coprocessor POST
Adds coprocessor communication POST code
---
v3 -> v4:
- use more generic name for coprocessor POST function
- move the POST code to board specific post/board/pdm360ng/ directory
include/configs/pdm360ng.h | 5 ++ include/post.h | 1 + post/board/pdm360ng/Makefile | 29 +++++++++++ post/board/pdm360ng/coproc_com.c | 97 ++++++++++++++++++++++++++++++++++++++ post/tests.c | 13 +++++ 5 files changed, 145 insertions(+), 0 deletions(-) create mode 100644 post/board/pdm360ng/Makefile create mode 100644 post/board/pdm360ng/coproc_com.c
include/configs/pdm360ng.h +5 -0
@@ -445,6 +445,11 @@#define CONFIG_KGDB_SER_INDEX 2/* which serial port to use */ #endif +#ifdef CONFIG_SERIAL_MULTI +/* POST support */ +#define CONFIG_POST (CONFIG_SYS_POST_COPROC) +#endif +/* * Environment Configuration */
include/post.h +1 -0
@@ -124,6 +124,7 @@ extern int post_hotkeys_pressed(void);#define CONFIG_SYS_POST_BSPEC4 0x00080000#define CONFIG_SYS_POST_BSPEC5 0x00100000#define CONFIG_SYS_POST_CODEC 0x00200000 +#define CONFIG_SYS_POST_COPROC 0x00400000#endif /* CONFIG_POST */
post/board/pdm360ng/Makefile new file +29 -0
@@ -0,0 +1,29 @@ +# +# (C) Copyright 2010 DENX Software Engineering +# Anatolij Gustschin, agust at denx.de. +# +# See file CREDITS for list of people who contributed to this +# project. +# +# 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. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, +# MA 02111-1307 USA +# +include $(OBJTREE)/include/autoconf.mk + +LIB = libpostpdm360ng.a + +COBJS-$(CONFIG_HAS_POST) += coproc_com.o + +include $(TOPDIR)/post/rules.mk
post/board/pdm360ng/coproc_com.c new file +97 -0
97 lines not on this page · raw message
post/tests.c +13 -0
@@ -53,6 +53,7 @@ extern int gdc_post_test (int flags);extern int fpga_post_test (int flags);extern int lwmon5_watchdog_post_test (int flags);extern int sysmon1_post_test (int flags); +extern int coprocessor_post_test (int flags);extern int sysmon_init_f (void );
@@ -286,6 +287,18 @@ struct post_test post_list[] =#if CONFIG_POST &CONFIG_SYS_POST_BSPEC5 CONFIG_POST_BSPEC5,#endif +#if CONFIG_POST &CONFIG_SYS_POST_COPROC + { +"Coprocessors communication test" , +"coproc_com" , +"This test checks communication with coprocessors." , +POST_RAM |POST_ALWAYS |POST_CRITICAL , + &coprocessor_post_test, +NULL , +NULL , + CONFIG_SYS_POST_COPROC + } +#endif };unsigned int post_list_size =sizeof (post_list) /sizeof (struct post_test );
Signature · 1 line
1.6.3.3
PATCH v4 6/8 mpc5121: add support for PDM360NG board
In reply to Anatolij GustschinQuoted 2 lines · Anatolij Gustschin
PDM360NG is a MPC5121E based board by ifm ecomatic gmbh.
[snip]
+#define CONFIG_SYS_INIT_RAM_END CONFIG_SYS_SRAM_SIZE
/* End of area */
+
+#define CONFIG_SYS_GBL_DATA_SIZE 0x100 /* num bytes of initial data */
+#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \
+ CONFIG_SYS_GBL_DATA_SIZE)
+#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
The CONFIG_SYS_POST_WORD_ADDR is not defined correctly. The base address is absent.
This will be fixed by POST cleanup consolidated patch anyway.
Regards,
Michael
PATCH v4 6/8 mpc5121: add support for PDM360NG board
Quoted 14 lines · On Sun, 9 May 2010 11:01:45 +0300 Michael Zaidman <[email protected]>…
Quoted 2 lines · Anatolij Gustschin
PDM360NG is a MPC5121E based board by ifm ecomatic gmbh.
[snip]
+#define
CONFIG_SYS_INIT_RAM_ENDCONFIG_SYS_SRAM_SIZE
/* End of area */include/configs/mpc5121-common.h new file +5
-0+ +#define CONFIG_SYS_GBL_DATA_SIZE 0x100/* num bytes of initial data */ +#define CONFIG_SYS_GBL_DATA_OFFSET (CONFIG_SYS_INIT_RAM_END - \ + CONFIG_SYS_GBL_DATA_SIZE) +#define CONFIG_SYS_POST_WORD_ADDR (CONFIG_SYS_GBL_DATA_OFFSET - 0x4)
Quoted 2 lines
The
CONFIG_SYS_POST_WORD_ADDRis not defined correctly. The base address is absent.
This is true. This macro is slightly confusing and for some other boards it actually means the post word offset. I should have defined _POST_ADDR as (CONFIG_SYS_SRAM_BASE + CONFIG_SYS_POST_WORD_ADDR) in .../mpc5121/common.c file. Since the post test on this board runs quite late (in RAM and not before relocation), this bug didn't show up. Thanks for reporting it!
Quoted 1 line
This will be fixed by POST cleanup consolidated patch anyway.
Thanks for this work!
Best regards,
Anatolij
Wolfgang Denk
AppliedPATCH v4 1/8 serial: struct serial_device: add uninit() entry for drivers
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 12 lines · In message <[email protected]> you wrote:
Subsequent patch extends mpc512x serial driver to support multiple PSC ports. The driver will provide an
uninit()function to stop the serial controller and to disable the controller's clock. Addinguninit()entry to structserial_deviceallows disabling the serial controller after usage of
a stdio serial device.This patch adds
uninit()entry to the structserial_deviceand fixes initialization of this structure in the code accordingly.Signed-off-by Anatolij Gustschin <[email protected]>
Quoted 11 lines
--- arch/powerpc/cpu/mpc5xxx/serial.c | 2 ++ arch/powerpc/cpu/mpc8xx/serial.c | 2 ++ arch/powerpc/cpu/ppc4xx/4xx_uart.c | 2 ++ board/logicpd/zoom2/zoom2_serial.h | 1 + drivers/serial/serial.c | 1 + drivers/serial/serial_pxa.c | 3 +++ drivers/serial/serial_s3c24x0.c | 1 + drivers/serial/serial_s5pc1xx.c | 1 + include/serial.h | 1 + 9 files changed, 14 insertions(+), 0 deletions(-)
This patch is actually not 5xxx related, so I pull it directly into "master".
Applied, thanks.
Best regards,
Wolfgang Denk
Signature · 6 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 There is, however, a strange, musty smell in the air that reminds me of something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit. - Larry Wall in Configure from the perl distribution
Wolfgang Denk
Appliedv4 cover Add support for PDM360NG board
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 11 lines · In message <[email protected]> you wrote:
These are reworked/rebased patches for PDM360NG board support. I expect them to be applied to u-boot-mpc5xxx branch (after removing four already applied patches from earlier version in the u-boot-mpc5xxx tree).
Changes since previous v3 are described in each
affected patch. First patch is new in this v4
series.Anatolij Gustschin (8):
serial: structserial_device: adduninit()entry for drivers
Applied to mainline repo, "master" branch.
Quoted 7 lines
mpc512x: add multi serial PSC support
mpc5121: add PSC serial communication routines
mpc512x: make MEM IO Control configuration a board config option
mpc5121: determine RAM size usingget_ram_size()
mpc5121: add support for PDM360NG board
mpc5121: add common post_word_load/store code
mpc5121: pdm360ng: add coprocessor POST
Applied to u-boot-mpc5xxx repo, "master" branch.
Thanks.
Um... my understanding is that the post_word_* stuff will be cleaned up later?
Best regards,
Wolfgang Denk
Signature · 5 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
Houston, Tranquillity Base here. The Eagle has landed.
-- Neil Armstrongv4 cover Add support for PDM360NG board
Dear Wolfgang,
On Sat, 24 Apr 2010 23:58:21 +0200
Wolfgang Denk <[email protected]> wrote:
...
Quoted 12 lines
Quoted 1 line
serial: struct
serial_device: adduninit()entry for driversApplied to mainline repo, "master" branch.
Quoted 7 lines
mpc512x: add multi serial PSC support
mpc5121: add PSC serial communication routines
mpc512x: make MEM IO Control configuration a board config option
mpc5121: determine RAM size usingget_ram_size()
mpc5121: add support for PDM360NG board
mpc5121: add common post_word_load/store code
mpc5121: pdm360ng: add coprocessor POST
Quoted 4 lines
Applied to u-boot-mpc5xxx repo, "master" branch.
Thanks.
Thanks.
Quoted 2 lines
Um... my understanding is that the post_word_* stuff will be cleaned up later?
Yes, I'm waiting for clean-up patches from Michael Zaidman, then I will take a look how to clean this up.
Best regards,
Anatolij