Add support for PDM360NG board
v2 cover Add support for PDM360NG board
This patch series intend to support MPC5121e based PDM360NG board. Patches preceding the actual board support patch 6 prepare needed infrastructure for the PDM360NG board.
Changes since first version:
- addressed comments, detailed log of changes is
provided in patch description.
NOTE:
- if splashscreen is used, another fix should also be applied, see patch
http://lists.denx.de/pipermail/u-boot/2010-March/068505.html
- for RLE8 BMP support see patch
http://lists.denx.de/pipermail/u-boot/2010-March/068476.html
Anatolij Gustschin (7):
mpc512x: make MEM IO Control configuration a board config option
mpc512x: add multi serial PSC support
mpc5121: add PSC serial communication routines
fdt_support: add partitions fixup in mtd node
mpc5121: add common post_word_load/store code
mpc5121: add support for PDM360NG board
mpc5121: cpu/mpc512x/diu.c: fix warnings
MAKEALL | 1 + Makefile | 3 + board/freescale/common/fsl_diu_fb.c | 29 ++- board/pdm360ng/Makefile | 52 ++++ board/pdm360ng/config.mk | 24 ++ board/pdm360ng/pdm360ng.c | 525 +++++++++++++++++++++++++++++++++++ board/pdm360ng/post.c | 75 +++++ common/cmd_mtdparts.c | 2 +- common/fdt_support.c | 219 +++++++++++++++ common/serial.c | 23 ++ cpu/mpc512x/Makefile | 1 + cpu/mpc512x/commproc.c | 25 ++ cpu/mpc512x/diu.c | 18 +- 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/mpc5121-common.h | 52 ++++ include/configs/mpc5121ads.h | 2 + include/configs/pdm360ng.h | 520 ++++++++++++++++++++++++++++++++++ include/fdt_support.h | 2 + include/jffs2/load_kernel.h | 1 + include/mtd_node.h | 11 + include/post.h | 1 + include/serial.h | 15 + post/tests.c | 4 + 27 files changed, 1981 insertions(+), 95 deletions(-) create mode 100644 board/pdm360ng/Makefile create mode 100644 board/pdm360ng/config.mk create mode 100644 board/pdm360ng/pdm360ng.c create mode 100644 board/pdm360ng/post.c create mode 100644 cpu/mpc512x/commproc.c create mode 100644 include/configs/mpc5121-common.h create mode 100644 include/configs/pdm360ng.h create mode 100644 include/mtd_node.h
PATCH v2 1/7 mpc512x: make MEM IO Control configuration a board config option
---
No changes since v1.
cpu/mpc512x/fixed_sdram.c | 2 +- include/asm-ppc/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(-)
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 );
include/asm-ppc/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 v2 2/7 mpc512x: add multi serial PSC support
Extend mpc512x serial driver to support multiple PSC ports.
Supsequent 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.
---
No changes since v1.
common/serial.c | 23 ++++ cpu/mpc512x/serial.c | 266 +++++++++++++++++++++++++++++++++++++----- include/asm-ppc/immap_512x.h | 108 +++++++++--------- include/serial.h | 8 ++ 4 files changed, 324 insertions(+), 81 deletions(-)
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;
cpu/mpc512x/serial.c +238 -28
361 lines not on this page · raw message
include/asm-ppc/immap_512x.h +55 -53
121 lines not on this page · raw message
include/serial.h +8 -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 );
@@ -37,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 v2 3/7 mpc5121: add PSC serial communication routines
---
No changes since v1.
cpu/mpc512x/serial.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/serial.h | 7 ++++ 2 files changed, 94 insertions(+), 0 deletions(-)
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 v2 4/7 fdt_support: add partitions fixup in mtd node
Allow overriding defined partitions in the device tree blob using partition info defined in the 'mtdparts' environment variable.
---
Changes since first version:
- in fdt_fixup_mtdparts() check the presence of "mtdparts" environment variable and don't proceed with initialisation if the variable is not defined (suppresses warning while booting).
common/cmd_mtdparts.c | 2 +- common/fdt_support.c | 219 +++++++++++++++++++++++++++++++++++++++++++ include/fdt_support.h | 2 + include/jffs2/load_kernel.h | 1 + include/mtd_node.h | 11 ++ 5 files changed, 234 insertions(+), 1 deletions(-) create mode 100644 include/mtd_node.h
common/cmd_mtdparts.c +1 -1
@@ -776,7 +776,7 @@ static int device_del(struct mtd_device *dev)* @param num device number * @return NULL if requested device does not exist */ -static struct mtd_device *device_find (u8 type,u8 num) +struct mtd_device *device_find (u8 type,u8 num) {struct list_head *entry;struct mtd_device *dev_tmp;
common/fdt_support.c +219 -0
222 lines not on this page · raw message
include/fdt_support.h +2 -0
@@ -81,5 +81,7 @@ int fdt_resize(void *blob);int fdt_fixup_nor_flash_size (void *blob,int cs,u32 size); +void fdt_fixup_mtdparts (void *fdt,void *node_info,int node_info_size); +#endif /* ifdef CONFIG_OF_LIBFDT */ #endif /* ifndef __FDT_SUPPORT_H */
include/jffs2/load_kernel.h +1 -0
@@ -78,5 +78,6 @@ struct mtdids {extern int mtdparts_init (void );extern int find_dev_and_part (const char *id,struct mtd_device **dev,u8 *part_num,struct part_info **part); +extern struct mtd_device *device_find (u8 type,u8 num);#endif /* load_kernel_h */
include/mtd_node.h new file +11 -0
@@ -0,0 +1,11 @@ +#ifndef _NODE_INFO +#define _NODE_INFO + +/* +* Info we use to search for a flash node in DTB. +*/ +struct node_info { +const char *compat;/* compatible string */ +int type;/* mtd flash type */ +}; +#endif
Signature · 1 line
1.6.3.3
PATCH v2 5/7 mpc5121: add common post_word_load/store code
Add common post_word_load/post_word_store routines for all mpc5121 boards. pdm360ng board support added by subsequent patches needs these, as it adds a board specific POST test.
---
This patch is new in this series. This code was in board support file in v1 patch series. Now it is common for mpc512x boards.
cpu/mpc512x/Makefile | 1 + cpu/mpc512x/commproc.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 cpu/mpc512x/commproc.c
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 += commproc.o COBJS-y += cpu_init.o COBJS-y += fixed_sdram.o COBJS-y += i2c.o
cpu/mpc512x/commproc.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 v2 6/7 mpc5121: add support for PDM360NG board
PDM360NG is a MPC5121E based board by ifm ecomatic gmbh.
---
Changes since first version:
- don't include RLE8 bitmap support in DIU code, now it is in common code submitted to U-Boot ML as separate patch. It is also extended to support more video formats.
- fixed e-mail format
- keep the list of targets sorted in the Makefile
- move POST code into separate file
- move post_word_load/store code to common file for all mpc512x boards
- create a file with common board config options for mpc512x boards which can be included in the board config file.
- use cfb_console driver for frame buffer support
- allow configuration of coprocessor communication parameters (baudrate, wait delay) in the board config file
MAKEALL | 1 + Makefile | 3 + board/freescale/common/fsl_diu_fb.c | 29 ++- board/pdm360ng/Makefile | 52 ++++ board/pdm360ng/config.mk | 24 ++ board/pdm360ng/pdm360ng.c | 525 +++++++++++++++++++++++++++++++++++ board/pdm360ng/post.c | 75 +++++ cpu/mpc512x/diu.c | 14 +- include/configs/mpc5121-common.h | 52 ++++ include/configs/pdm360ng.h | 520 ++++++++++++++++++++++++++++++++++ include/post.h | 1 + post/tests.c | 4 + 12 files changed, 1294 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 board/pdm360ng/post.c create mode 100644 include/configs/mpc5121-common.h create mode 100644 include/configs/pdm360ng.h
MAKEALL +1 -0
@@ -93,6 +93,7 @@ LIST_512x=" \ aria \ mecp5123 \ mpc5121ads \ + pdm360ng \ " #########################################################################
Makefile +3 -0
@@ -828,6 +828,9 @@ mpc5121ads_rev2_config \ fi @$(MKCONFIG) -a mpc5121ads ppc mpc512x mpc5121ads freescale +pdm360ng_config: unconfig + @$(MKCONFIG) -a pdm360ng ppc mpc512x pdm360ng + ######################################################################### ## MPC8xx Systems #########################################################################
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 =FB_SYNC_COMP_HIGH_ACT |FB_SYNC_VERT_HIGH_ACT , + .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 +52 -0
52 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 +525 -0
525 lines not on this page · raw message
board/pdm360ng/post.c new file +75 -0
75 lines not on this page · raw message
cpu/mpc512x/diu.c +12 -2
@@ -68,8 +68,13 @@ char *valid_bmp(char *addr)unsigned long h_addr; 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 < CONFIG_SYS_FLASH_BASE || + h_addr >= (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE - 1)) +#if defined(CONFIG_SYS_FLASH1_BASE ) && defined(CONFIG_SYS_FLASH1_SIZE ) + && (h_addr < CONFIG_SYS_FLASH1_BASE || + h_addr >= (CONFIG_SYS_FLASH1_BASE + CONFIG_SYS_FLASH1_SIZE - 1)) +#endif + ) {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')) {
@@ -85,8 +90,13 @@ int mpc5121_diu_init(void)char *bmp =NULL ;char *bmp_env; +#ifdef CONFIG_PDM360NG + xres =800 ; + yres =480 ; +#else xres =1024 ; yres =768 ; +#endif pixel_format =0x88883316 ;debug ("mpc5121_diu_init\n" );
include/configs/mpc5121-common.h new file +52 -0
52 lines not on this page · raw message
include/configs/pdm360ng.h new file +520 -0
520 lines not on this page · raw message
include/post.h +1 -0
@@ -119,6 +119,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/tests.c +4 -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 pdm360ng_coprocessor_post_test (int flags);extern int sysmon_init_f (void );
@@ -286,6 +287,9 @@ struct post_test post_list[] =#if CONFIG_POST &CONFIG_SYS_POST_BSPEC5 CONFIG_POST_BSPEC5,#endif +#if CONFIG_POST &CONFIG_SYS_POST_COPROC + CONFIG_POST_COPROC, +#endif };unsigned int post_list_size =sizeof (post_list) /sizeof (struct post_test );
Signature · 1 line
1.6.3.3
PATCH v2 7/7 mpc5121: cpu/mpc512x/diu.c: fix warnings
Fix warnings while compiling with CONFIG_VIDEO enabled:
diu.c: In function 'video_hw_init':
diu.c:158: warning: 'return' with no value, in function returning non-void diu.c:162: warning: format '%ld' expects type 'long int', but argument 6 has type 'int' diu.c:162: warning: format '%ld' expects type 'long int', but argument 7 has type 'int'
---
New patch in this series, needed after cfb_console driver activation.
cpu/mpc512x/diu.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
cpu/mpc512x/diu.c +2 -2
@@ -155,10 +155,10 @@ void *video_hw_init(void)struct fb_info *info;if (mpc5121_diu_init () <0 ) -return ; +return NULL ;/* fill in Graphic device struct */ -sprintf (pGD->modeIdent,"%dx%dx%d %ldkHz %ldHz" , +sprintf (pGD->modeIdent,"%dx%dx%d %dkHz %dHz" , xres, yres,32 ,64 ,60 ); pGD->frameAdrs = (unsigned int )fsl_fb_open (&info);
Signature · 1 line
1.6.3.3
Wolfgang Denk
AppliedPATCH v2 7/7 mpc5121: cpu/mpc512x/diu.c: fix warnings
Dear Anatolij Gustschin,
Quoted 7 lines · In message <[email protected]> you wrote:
Fix warnings while compiling with
CONFIG_VIDEOenabled:
diu.c: In function 'video_hw_init':
diu.c:158: warning: 'return' with no value, in function returning non-void diu.c:162: warning: format '%ld' expects type 'long int', but argument 6 has type 'int' diu.c:162: warning: format '%ld' expects type 'long int', but argument 7 has type 'int'
Quoted 6 lines
Signed-off-by Anatolij Gustschin <[email protected]>---
New patch in this series, needed aftercfb_consoledriver activation.cpu/mpc512x/diu.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
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 Hi there! This is just a note from me, to you, to tell you, the per- son reading this note, that I can't think up any more famous quotes, jokes, nor bizarre stories, so you may as well go home.
PATCH v2 6/7 mpc5121: add support for PDM360NG board
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 16 lines · In message <[email protected]> you wrote:
--===============0837153488==
PDM360NG is a MPC5121E based board by ifm ecomatic gmbh.
Signed-off-by Michael Weiss <[email protected]>Signed-off-by Anatolij Gustschin <[email protected]>---
Changes since first version:
- don't include RLE8 bitmap support in DIU code, now it is in common code submitted to U-Boot ML as separate patch. It is also extended to support more video formats.
- fixed e-mail format
- keep the list of targets sorted in theMakefile
- move POST code into separate file
- move post_word_load/store code to common file for
Quoted 8 lines
all mpc512x boards
- create a file with common board config options for mpc512x boards which can be included in the board config file.
- usecfb_consoledriver for frame buffer support
- allow configuration of coprocessor communication parameters (baudrate, wait delay) in the board config file
I see you already addressed a number of issues I mentioned in my previous review of this patch.
Some others are still open:
Quoted 11 lines
MAKEALL | 1 + Makefile | 3 + board/freescale/common/fsl_diu_fb.c | 29 ++- board/pdm360ng/Makefile | 52 ++++ board/pdm360ng/config.mk | 24 ++ board/pdm360ng/pdm360ng.c | 525 +++++++++++++++++++++++++++++++++++ board/pdm360ng/post.c | 75 +++++ cpu/mpc512x/diu.c | 14 +- include/configs/mpc5121-common.h | 52 ++++ include/configs/pdm360ng.h | 520 ++++++++++++++++++++++++++++++++++ include/post.h | 1 +
Quoted 8 lines
post/tests.c | 4 + 12 files changed, 1294 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 board/pdm360ng/post.c create mode 100644 include/configs/mpc5121-common.h create mode 100644 include/configs/pdm360ng.h
Entry to MAINTAINERS file is missing.
Quoted 19 lines
board/pdm360ng/pdm360ng.c new file +19
-0+#if defined(CONFIG_HARD_I2C ) +if (!getenv ("ethaddr" )) { +uchar buf[6 ]; +char mac[18 ]; +int ret; + +/* I2C-0 for on-board eeprom */ +i2c_set_bus_num (CONFIG_SYS_I2C_EEPROM_BUS_NUM ); + +/* Read ethaddr from EEPROM */ + ret =i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR , +CONFIG_SYS_I2C_EEPROM_MAC_OFFSET ,1 , buf,6 ); +if (!ret) { +sprintf (mac,"%02X:%02X:%02X:%02X:%02X:%02X" , + buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ], buf[5 ]); +/* Owned by IFM ? */ +if (strstr (mac,"00:02:01" ) != mac) { +printf ("Illegal MAC address in EEPROM: %s\n" , + mac);
board/pdm360ng/pdm360ng.c line 191
Quoted 10 lines
board/pdm360ng/pdm360ng.c new file +10
-0+ }else { +debug ("Using MAC from I2C EEPROM: %s\n" , mac); +setenv ("ethaddr" , mac); + } + }else { +printf ("Error: Unable to read MAC from I2C" +" EEPROM at address %02X:%02X\n" , +CONFIG_SYS_I2C_EEPROM_ADDR , +CONFIG_SYS_I2C_EEPROM_MAC_OFFSET ); + }
Please see comments in previous message. IMHO this needs to be rewritten.
board/pdm360ng/pdm360ng.c line 454
Quoted 9 lines
board/pdm360ng/pdm360ng.c new file +9
-0+#if defined(CONFIG_SERIAL_MULTI ) +/* +* If argument is NULL, set the LCD brightness to the +* value from "brightness" environment variable. Set +* the LCD brightness to the value specified by the +* argument otherwise. Default brightness is zero. +*/ +#define MAX_BRIGHTNESS 99 +static int set_lcd_brightness (char *brightness)
This seems wrong to me. Why does LCD related code depend on CONFIG_SERIAL_MULTI ???
Quoted 7 lines
cpu/mpc512x/diu.c +0
-0@@ -68,8 +68,13 @@ char *valid_bmp(char *addr)unsigned long h_addr;
cpu/mpc512x/diu.c char *valid_bmp(char *addr) · line 77
Quoted 10 lines
cpu/mpc512x/diu.c +7
-2h_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 < CONFIG_SYS_FLASH_BASE || + h_addr >= (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE - 1)) +#if defined(CONFIG_SYS_FLASH1_BASE ) && defined(CONFIG_SYS_FLASH1_SIZE ) + && (h_addr < CONFIG_SYS_FLASH1_BASE || + h_addr >= (CONFIG_SYS_FLASH1_BASE + CONFIG_SYS_FLASH1_SIZE - 1)) +#endif + ) {
I don't like this. Why do we see hardcoded values here and not the data from the CFI driver's auto-sizing? I assume both flash banks are maped into one big contiguous array of NOR flash, right? Then there should be just a single test for "< base || >(base+size)" here, using the total size of the combined flash banks.
cpu/mpc512x/diu.c char *valid_bmp(char *addr) · line 79
Quoted 2 lines
cpu/mpc512x/diu.c +0
-0printf ("bmp addr %lx is not a valid flash address\n" , h_addr);return 0 ;
And why would it be necessary that the BMP resides in NOR flash in the first place?
Why cannot - for example - a "preboot" command be used to read it from SDCard into RAM?
[I am aware that you did not create this code, but anyways - it seems wrong to me.]
cpu/mpc512x/diu.c int mpc5121_diu_init(void) · line 99
Quoted 12 lines
cpu/mpc512x/diu.c +5
-0}else if ((*(char *)(h_addr) !='B' ) || (*(char *)(h_addr+1 ) !='M' )) {@@ -85,8 +90,13 @@ int mpc5121_diu_init(void)char *bmp =NULL ;char *bmp_env; +#ifdef CONFIG_PDM360NG + xres =800 ; + yres =480 ; +#else xres =1024 ; yres =768 ; +#endif
Please avoid the board specific #define here. Please check for a feature instead (resolution = 800x400).
cpu/mpc512x/diu.c int mpc5121_diu_init(void)
Quoted 4 lines
cpu/mpc512x/diu.c +4
-0+#ifndef __CONFIG_H +#define __CONFIG_H + +#undef DEBUG
Please remove dead code.
cpu/mpc512x/diu.c
Quoted 3 lines
cpu/mpc512x/diu.c +3
-0+#define CONFIG_PDM360NG 1 +#define CONFIG_PDM360NG_BIG /* PDM360NG with big memory */ +#undef CONFIG_PDM360NG_SMALL/* PDM360NG with small memory */
This makes no sense. If you want to toggle between "small" and "big" configurations, then please use a single #define which is either set or not set.
I don't see why this is needed at all. Does not U-Boot auto-detect the RAM size, so you can auto-adjust all code where needed? If not, then this should be fixed.
cpu/mpc512x/diu.c
Quoted 10 lines
cpu/mpc512x/diu.c +10
-0+/* +* DDR Setup - manually set all parameters as there's no SPD etc. +*/ +#ifdef CONFIG_PDM360NG_BIG +#define CONFIG_SYS_DDR_SIZE 512/* MB */ +#elif definedCONFIG_PDM360NG_SMALL +#define CONFIG_SYS_DDR_SIZE 128/* MB */ +#else +#error No memory configuration level defined! +#endif
Please use auto-sizing with get_ram_size() instead, so a single U-Boot image can be used with both configurations.
Quoted 2 lines
+/* DDR Controller Configuration for Micron DDR2 SDRAM MT47H128M8-3
+ *
Incorrect multiline comment format.
And: comment and code seem to differ - the comment explains one configuration, but the code has 2 ("small" and "big") ?
cpu/mpc512x/diu.c
Quoted 10 lines
cpu/mpc512x/diu.c +10
-0+#define CONFIG_SYS_DDRCMD_NOP 0x01380000 +#define CONFIG_SYS_DDRCMD_PCHG_ALL 0x01100400 +#define CONFIG_SYS_DDRCMD_EM2 0x01020000/* EMR2 */ +#define CONFIG_SYS_DDRCMD_EM3 0x01030000/* EMR3 */ +#define CONFIG_SYS_DDRCMD_EN_DLL 0x01010040/* EMR with 150 ohm ODT todo: verify*/ +#define CONFIG_SYS_DDRCMD_RES_DLL 0x01000100 +#define CONFIG_SYS_DDRCMD_RFSH 0x01080000 +#define CONFIG_SYS_MICRON_INIT_DEV_OP 0x01000432 +#define CONFIG_SYS_DDRCMD_OCD_DEFAULT 0x010107C0/* EMR with 150 ohm ODT todo: verify*/ +#define CONFIG_SYS_DDRCMD_OCD_EXIT 0x01010440/* EMR new command with 150 ohm ODT todo: verify*/
Lines way too long. Please fix globally.
cpu/mpc512x/diu.c
Quoted 4 lines
+ * Serial Port
+ */cpu/mpc512x/diu.c +2
-0+#define CONFIG_CONS_INDEX 1 +#undef CONFIG_SERIAL_SOFTWARE_FIFO
Please do not #undef what is not defined anyway. Please remove dead code globally.
cpu/mpc512x/diu.c
Quoted 10 lines
cpu/mpc512x/diu.c +10
-0+#define CONFIG_CMD_ASKENV +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_I2C +#define CONFIG_CMD_MII +#define CONFIG_CMD_NFS +#define CONFIG_CMD_PING +#define CONFIG_CMD_REGINFO +#define CONFIG_CMD_EEPROM +#define CONFIG_CMD_DATE +#undef CONFIG_CMD_FUSE
You may want to sort that list.
cpu/mpc512x/diu.c
Quoted 11 lines
cpu/mpc512x/diu.c +11
-0+#define CONFIG_POST_COPROC {\ + "Coprocessors communication test", \ + "coproc_com", \ + "This test checks communication with coprocessors.", \ + POST_RAM | POST_ALWAYS | POST_CRITICAL, \ + &pdm360ng_coprocessor_post_test, \ + NULL, \ + NULL, \ + CONFIG_SYS_POST_COPROC \ + } +#endif
This does not belong into the board config file.
include/post.h extern int post_hotkeys_pressed(void); · line 122
Quoted 9 lines
include/post.h +1
-0@@ -119,6 +119,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
Please split the POST specific code out into a separate commit.
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 There's an old proverb that says just about whatever you want it to.
PATCH v2 6/7 mpc5121: add support for PDM360NG board
Hello Wolfgang,
On Sun, 21 Mar 2010 20:23:06 +0100
Wolfgang Denk <[email protected]> wrote:
...
Quoted 9 lines
Quoted 7 lines
12 files changed, 1294 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 board/pdm360ng/post.c create mode 100644 include/configs/mpc5121-common.h create mode 100644 include/configs/pdm360ng.hEntry to
MAINTAINERSfile is missing.
Ok, will fix it.
Quoted 24 lines
Quoted 24 lines
board/pdm360ng/pdm360ng.c new file +24
-0+#if defined(CONFIG_HARD_I2C ) +if (!getenv ("ethaddr" )) { +uchar buf[6 ]; +char mac[18 ]; +int ret; + +/* I2C-0 for on-board eeprom */ +i2c_set_bus_num (CONFIG_SYS_I2C_EEPROM_BUS_NUM ); + +/* Read ethaddr from EEPROM */ + ret =i2c_read (CONFIG_SYS_I2C_EEPROM_ADDR , +CONFIG_SYS_I2C_EEPROM_MAC_OFFSET ,1 , buf,6 ); +if (!ret) { +sprintf (mac,"%02X:%02X:%02X:%02X:%02X:%02X" , + buf[0 ], buf[1 ], buf[2 ], buf[3 ], buf[4 ], buf[5 ]); +/* Owned by IFM ? */ +if (strstr (mac,"00:02:01" ) != mac) { +printf ("Illegal MAC address in EEPROM: %s\n" , + mac); + }else { +debug ("Using MAC from I2C EEPROM: %s\n" , mac); +setenv ("ethaddr" , mac); + } + }else {
Quoted 8 lines
board/pdm360ng/pdm360ng.c line 191
Quoted 5 lines
board/pdm360ng/pdm360ng.c new file +5
-0+printf ("Error: Unable to read MAC from I2C" +" EEPROM at address %02X:%02X\n" , +CONFIG_SYS_I2C_EEPROM_ADDR , +CONFIG_SYS_I2C_EEPROM_MAC_OFFSET ); + }Please see comments in previous message. IMHO this needs to be rewritten.
Ok, I will rewrite it as suggested. Thanks.
Quoted 13 lines
board/pdm360ng/pdm360ng.c line 454
Quoted 10 lines
board/pdm360ng/pdm360ng.c new file +9
-0+#if defined(CONFIG_SERIAL_MULTI ) +/* +* If argument is NULL, set the LCD brightness to the +* value from "brightness" environment variable. Set +* the LCD brightness to the value specified by the +* argument otherwise. Default brightness is zero. +*/ +#define MAX_BRIGHTNESS 99 +static int set_lcd_brightness (char *brightness)This seems wrong to me. Why does LCD related code depend on
CONFIG_SERIAL_MULTI???
The reason for this is that LCD brightness is controlled by sending commands to the I/O Coprocessor over serial line (PSC4). If CONFIG_SERIAL_MULTI is not selected, there is no possibility to set the brightness, so it doesn't make sense to include this code then.
Quoted 7 lines
Quoted 7 lines
cpu/mpc512x/diu.c +0
-0@@ -68,8 +68,13 @@ char *valid_bmp(char *addr)unsigned long h_addr;
Quoted 16 lines
cpu/mpc512x/diu.c char *valid_bmp(char *addr) · line 77
Quoted 10 lines
cpu/mpc512x/diu.c +7
-2h_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 < CONFIG_SYS_FLASH_BASE || + h_addr >= (CONFIG_SYS_FLASH_BASE + CONFIG_SYS_FLASH_SIZE - 1)) +#if defined(CONFIG_SYS_FLASH1_BASE ) && defined(CONFIG_SYS_FLASH1_SIZE ) + && (h_addr < CONFIG_SYS_FLASH1_BASE || + h_addr >= (CONFIG_SYS_FLASH1_BASE + CONFIG_SYS_FLASH1_SIZE - 1)) +#endif + ) {I don't like this. Why do we see hardcoded values here and not the data from the CFI driver's auto-sizing? I assume both flash banks are maped into one big contiguous array of NOR flash, right? Then there should be just a single test for "< base || >(base+size)" here, using the total size of the combined flash banks.
Will fix it using a single test as suggested. Thanks!
Quoted 5 lines
cpu/mpc512x/diu.c char *valid_bmp(char *addr) · line 79
Quoted 2 lines
cpu/mpc512x/diu.c +0
-0printf ("bmp addr %lx is not a valid flash address\n" , h_addr);return 0 ;And why would it be necessary that the BMP resides in NOR flash in the first place?
This check is only done while first DIU init. It checks the BMP address in "diu_bmp_addr" environment variable which is supposed to point to a bitmap in flash.
Quoted 5 lines
Why cannot - for example - a "preboot" command be used to read it from SDCard into RAM?
[I am aware that you did not create this code, but anyways - it seems wrong to me.]
Displaying a bitmap form RAM can be done later by running "diufb addr" and this command doesn't perform the above check.
Quoted 10 lines
cpu/mpc512x/diu.c int mpc5121_diu_init(void) · line 99
Quoted 7 lines
cpu/mpc512x/diu.c +5
-0+#ifdef CONFIG_PDM360NG + xres =800 ; + yres =480 ; +#else xres =1024 ; yres =768 ; +#endif Please avoid the board specific #define here. Please check for a feature instead (resolution = 800x400).
I will fix it using CONFIG macros for resolution.
...
Quoted 3 lines
Quoted 1 line
+#undef DEBUG
Please remove dead code.
Ok, will fix. Thanks!
Quoted 12 lines
cpu/mpc512x/diu.c
Quoted 3 lines
cpu/mpc512x/diu.c +3
-0+#define CONFIG_PDM360NG 1 +#define CONFIG_PDM360NG_BIG /* PDM360NG with big memory */ +#undef CONFIG_PDM360NG_SMALL/* PDM360NG with small memory */ This makes no sense. If you want to toggle between "small" and "big" configurations, then please use a single #define which is either set or not set.
I don't see why this is needed at all. Does not U-Boot auto-detect the RAM size, so you can auto-adjust all code where needed? If not, then this should be fixed.
Quoted 13 lines
cpu/mpc512x/diu.c
Quoted 10 lines
cpu/mpc512x/diu.c +10
-0+/* +* DDR Setup - manually set all parameters as there's no SPD etc. +*/ +#ifdef CONFIG_PDM360NG_BIG +#define CONFIG_SYS_DDR_SIZE 512/* MB */ +#elif definedCONFIG_PDM360NG_SMALL +#define CONFIG_SYS_DDR_SIZE 128/* MB */ +#else +#error No memory configuration level defined! +#endif Please use auto-sizing with
get_ram_size()instead, so a single U-Boot image can be used with both configurations.
I will use get_ram_size() in fixed_sdram() to determine the size, but we still need to differentiate between "big" and "small" configuration as some parameters are different for 128 MB configuration and cannot be determined using SPD.
Quoted 7 lines
Quoted 2 lines
+/* DDR Controller Configuration for Micron DDR2 SDRAM MT47H128M8-3
+ *Incorrect multiline comment format.
And: comment and code seem to differ - the comment explains one configuration, but the code has 2 ("small" and "big") ?
Will fix and move the comment to "big" configuration.
Quoted 4 lines
Quoted 4 lines
cpu/mpc512x/diu.c +4
-0+#define CONFIG_SYS_DDRCMD_NOP 0x01380000 +#define CONFIG_SYS_DDRCMD_PCHG_ALL 0x01100400 +#define CONFIG_SYS_DDRCMD_EM2 0x01020000/* EMR2 */ +#define CONFIG_SYS_DDRCMD_EM3 0x01030000/* EMR3 */
Quoted 8 lines
cpu/mpc512x/diu.c
Quoted 6 lines
cpu/mpc512x/diu.c +6
-0+#define CONFIG_SYS_DDRCMD_EN_DLL 0x01010040/* EMR with 150 ohm ODT todo: verify*/ +#define CONFIG_SYS_DDRCMD_RES_DLL 0x01000100 +#define CONFIG_SYS_DDRCMD_RFSH 0x01080000 +#define CONFIG_SYS_MICRON_INIT_DEV_OP 0x01000432 +#define CONFIG_SYS_DDRCMD_OCD_DEFAULT 0x010107C0/* EMR with 150 ohm ODT todo: verify*/ +#define CONFIG_SYS_DDRCMD_OCD_EXIT 0x01010440/* EMR new command with 150 ohm ODT todo: verify*/ Lines way too long. Please fix globally.
Will fix. Thanks.
Quoted 7 lines
cpu/mpc512x/diu.c
Quoted 4 lines
+ * Serial Port
+ */cpu/mpc512x/diu.c +2
-0+#define CONFIG_CONS_INDEX 1 +#undef CONFIG_SERIAL_SOFTWARE_FIFOPlease do not #undef what is not defined anyway. Please remove dead code globally.
Ok, fixed.
Quoted 4 lines
Quoted 4 lines
cpu/mpc512x/diu.c +4
-0+#define CONFIG_CMD_ASKENV +#define CONFIG_CMD_DHCP +#define CONFIG_CMD_I2C +#define CONFIG_CMD_MII
Quoted 8 lines
cpu/mpc512x/diu.c
Quoted 6 lines
cpu/mpc512x/diu.c +6
-0+#define CONFIG_CMD_NFS +#define CONFIG_CMD_PING +#define CONFIG_CMD_REGINFO +#define CONFIG_CMD_EEPROM +#define CONFIG_CMD_DATE +#undef CONFIG_CMD_FUSEYou may want to sort that list.
Will do.
Quoted 5 lines
Quoted 5 lines
cpu/mpc512x/diu.c +5
-0+#define CONFIG_POST_COPROC {\ + "Coprocessors communication test", \ + "coproc_com", \ + "This test checks communication with coprocessors.", \ + POST_RAM | POST_ALWAYS | POST_CRITICAL, \
Quoted 8 lines
cpu/mpc512x/diu.c
Quoted 6 lines
cpu/mpc512x/diu.c +6
-0+ &pdm360ng_coprocessor_post_test, \ + NULL, \ + NULL, \ + CONFIG_SYS_POST_COPROC \ + } +#endif This does not belong into the board config file.
Ok, I will move it to post/tests.c file.
Quoted 11 lines
include/post.h extern int post_hotkeys_pressed(void); · line 122
Quoted 9 lines
include/post.h +1
-0@@ -119,6 +119,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 0x00400000Please split the POST specific code out into a separate commit.
OK.
Thanks!
Anatolij
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
v3 cover Add support for PDM360NG board
In reply to Wolfgang DenkThese are remaining reworked patches for PDM360NG board support. I expect them to be applied to u-boot-mpc5xxx branch (after applying another already submitted patch [1] for fixing the problem with bricking the boards after commit d774442c60756a8dd5d75de85574120ce375bd72 and then rebasing this branch to new directory structure).
[1] http://lists.denx.de/pipermail/u-boot/2010-April/070018.html
Anatolij Gustschin (3):
mpc5121: determine RAM size using get_ram_size()
mpc5121: add support for PDM360NG board
mpc5121: pdm360ng: add coprocessor POST
MAINTAINERS | 4 + MAKEALL | 1 + Makefile | 3 + arch/ppc/cpu/mpc512x/diu.c | 12 +- arch/ppc/cpu/mpc512x/fixed_sdram.c | 7 +- board/freescale/common/fsl_diu_fb.c | 29 ++- board/pdm360ng/Makefile | 52 ++++ board/pdm360ng/config.mk | 24 ++ board/pdm360ng/pdm360ng.c | 521 +++++++++++++++++++++++++++++++++++ board/pdm360ng/post.c | 75 +++++ include/configs/mpc5121-common.h | 53 ++++ include/configs/pdm360ng.h | 497 +++++++++++++++++++++++++++++++++ include/post.h | 1 + post/tests.c | 13 + 14 files changed, 1285 insertions(+), 7 deletions(-) create mode 100644 board/pdm360ng/Makefile create mode 100644 board/pdm360ng/config.mk create mode 100644 board/pdm360ng/pdm360ng.c create mode 100644 board/pdm360ng/post.c create mode 100644 include/configs/mpc5121-common.h create mode 100644 include/configs/pdm360ng.h
PATCH v3 1/3 mpc5121: determine RAM size using get_ram_size()
Configure 1GiB address range in DDR LAW and
determine the RAM size. Fix DDR LAW afterwards.
--- arch/ppc/cpu/mpc512x/fixed_sdram.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-)
arch/ppc/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 =1024 *1024 *1024 ;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 ,0x40000000 ); +/* Fix DDR Local Window for new size */ +out_be32 (&im->sysconf.ddrlaw.ar,__ilog2 (msize) -1 ); +sync_law (&im->sysconf.ddrlaw.ar); +return msize; }
Signature · 1 line
1.6.3.3
PATCH v3 2/3 mpc5121: add support for PDM360NG board
PDM360NG is a MPC5121E based board by ifm ecomatic gmbh.
---
Changes since v2:
Addressed comments from Wolfgang:
- added board maintainer to MAINTAINERS
- simplified code for setting ethaddr from EEPROM as suggested by Wolfgang
- simplified flash address range check using data from the CFI driver's auto-sizing
- don't use board specific #define for resolution 800x480, replaced by CONFIG macros
- removed dead code (#undef)
- toggle between "small" and "big" configurations using single #define
- don't use DDR RAM size config macro, get_ram_size() is used now in fixed_sdram() to determine RAM size (see previous patch 1/3)
- fixed multiline comment format, moved the comment to appropriate code
- fixed too long lines globaly
- sorted CONFIG_CMD_* list
- split POST specific board code out into a separate commit (in following patch 3/3)
- rebased to apply on reworked directory structure
- merged two new patches from Detlev from u-boot-testing:
pdm360ng: Add GPT2 as GPIO pin
pdm360ng: Adapt PIN muxing to support Revision 3 prototype
MAINTAINERS | 4 + MAKEALL | 1 + Makefile | 3 + arch/ppc/cpu/mpc512x/diu.c | 12 +- board/freescale/common/fsl_diu_fb.c | 29 ++- board/pdm360ng/Makefile | 51 ++++ board/pdm360ng/config.mk | 24 ++ board/pdm360ng/pdm360ng.c | 521 +++++++++++++++++++++++++++++++++++ include/configs/mpc5121-common.h | 53 ++++ include/configs/pdm360ng.h | 492 +++++++++++++++++++++++++++++++++ 10 files changed, 1184 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
@@ -813,6 +813,9 @@ mpc5121ads_rev2_config \ fi @$(MKCONFIG) -a mpc5121ads ppc mpc512x mpc5121ads freescale +pdm360ng_config: unconfig + @$(MKCONFIG) -a pdm360ng ppc mpc512x pdm360ng + ######################################################################### ## MPC8xx Systems #########################################################################
arch/ppc/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" );
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 =FB_SYNC_COMP_HIGH_ACT |FB_SYNC_VERT_HIGH_ACT , + .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 +521 -0
521 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 +492 -0
492 lines not on this page · raw message
Signature · 1 line
1.6.3.3
PATCH v3 3/3 mpc5121: pdm360ng: add coprocessor POST
Adds coprocessor communication POST code.
--- board/pdm360ng/Makefile | 1 + board/pdm360ng/post.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ include/configs/pdm360ng.h | 5 +++ include/post.h | 1 + post/tests.c | 13 +++++++ 5 files changed, 95 insertions(+), 0 deletions(-) create mode 100644 board/pdm360ng/post.c
board/pdm360ng/Makefile +1 -0
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk LIB = $(obj)lib$(BOARD).a COBJS-y := $(BOARD).o +COBJS-$(CONFIG_HAS_POST) += post.o COBJS := $(COBJS-y) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c)
board/pdm360ng/post.c new file +75 -0
75 lines not on this page · raw message
include/configs/pdm360ng.h +5 -0
@@ -456,6 +456,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/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 pdm360ng_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 , + &pdm360ng_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 v3 3/3 mpc5121: pdm360ng: add coprocessor POST
Dear Anatolij Gustschin,
Quoted 11 lines · In message <[email protected]> you wrote:
Adds coprocessor communication POST code.
Signed-off-by Anatolij Gustschin <[email protected]>--- board/pdm360ng/Makefile | 1 + board/pdm360ng/post.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ include/configs/pdm360ng.h | 5 +++ include/post.h | 1 + post/tests.c | 13 +++++++ 5 files changed, 95 insertions(+), 0 deletions(-) create mode 100644 board/pdm360ng/post.c
...
Quoted 17 lines
post/tests.c +4
-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 pdm360ng_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",
post/tests.c struct post_test post_list[] = · line 302
Quoted 10 lines
post/tests.c +9
-0+"coproc_com" , +"This test checks communication with coprocessors." , +POST_RAM |POST_ALWAYS |POST_CRITICAL , + &pdm360ng_coprocessor_post_test, +NULL , +NULL , +CONFIG_SYS_POST_COPROC + } +#endif };
I don't want to see board specific code (pdm360ng_*) in such a global file. Please use a more generic approach.
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 When a program is being tested, it is too late to make design changes. -- Geoffrey James, "The Tao of Programming"
PATCH v3 3/3 mpc5121: pdm360ng: add coprocessor POST
Hi Wolfgang,
Quoted 37 lines
Dear Anatolij Gustschin,
Quoted 11 lines · In message <[email protected]> you wrote:
Adds coprocessor communication POST code.
Signed-off-by Anatolij Gustschin <[email protected]>--- board/pdm360ng/Makefile | 1 + board/pdm360ng/post.c | 75 ++++++++++++++++++++++++++++++++++++++++++++ include/configs/pdm360ng.h | 5 +++ include/post.h | 1 + post/tests.c | 13 +++++++ 5 files changed, 95 insertions(+), 0 deletions(-) create mode 100644 board/pdm360ng/post.c...
Quoted 22 lines
post/tests.c +9
-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 pdm360ng_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 , + &pdm360ng_coprocessor_post_test, + NULL,
Quoted 8 lines
post/tests.c struct post_test post_list[] = · line 302
Quoted 5 lines
post/tests.c +4
-0+ NULL, + CONFIG_SYS_POST_COPROC + } +#endif };I don't want to see board specific code (pdm360ng_*) in such a global file. Please use a more generic approach.
Do you mean like for example CONFIG_POST_BSPEC1 used for lwmon5?
Anatolij, this should be straight forward.
Cheers
Detlev
Signature · 7 lines
C hasn't changed much since the 1970s. And let's face it it's ugly.
Can't we do better? C++? (Sorry, never mind.)
-- Rob Pike
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.dePATCH v3 3/3 mpc5121: pdm360ng: add coprocessor POST
Hi Detlev,
On Thu, 15 Apr 2010 11:18:13 +0200
Detlev Zundel <[email protected]> wrote:
...
Quoted 21 lines
Quoted 12 lines
Quoted 12 lines
post/tests.c +8
-0@@ -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 , + &pdm360ng_coprocessor_post_test, + NULL,Quoted 8 lines
post/tests.c struct post_test post_list[] = · line 302
Quoted 5 lines
post/tests.c +4
-0+ NULL, + CONFIG_SYS_POST_COPROC + } +#endif };I don't want to see board specific code (pdm360ng_*) in such a global file. Please use a more generic approach.
Quoted 3 lines
Do you mean like for example
CONFIG_POST_BSPEC1used for lwmon5?Anatolij, this should be straight forward.
Similar was in the first patch version. But according to Wolfgang this doesn't belong in the board config file.
Anatolij
PATCH v3 3/3 mpc5121: pdm360ng: add coprocessor POST
Dear Anatolij Gustschin,
Quoted 3 lines · In message <20100415112520.3b6c341d@wker> you wrote:
Similar was in the first patch version. But according to Wolfgang this doesn't belong in the board config file.
Eventually I did not understand the whole scope of the problem, then. In any case we should keep such common files clear of board specific stuff, and use feature specfic names instead.
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 I express preference for a chronological sequence of events which precludes a violence. - Terry Pratchett, _The Dark Side of the Sun_
PATCH v3 3/3 mpc5121: pdm360ng: add coprocessor POST
In reply to Detlev ZundelDear Detlev Zundel,
Quoted 22 lines · In message <[email protected]> you wrote:
Quoted 13 lines
Quoted 13 lines
post/tests.c +8
-0@@ -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 , + &pdm360ng_coprocessor_post_test, + NULL,Quoted 8 lines
post/tests.c struct post_test post_list[] = · line 302
Quoted 5 lines
post/tests.c +4
-0+ NULL, + CONFIG_SYS_POST_COPROC + } +#endif };I don't want to see board specific code (pdm360ng_*) in such a global file. Please use a more generic approach.
Quoted 1 line
Do you mean like for example
CONFIG_POST_BSPEC1used for lwmon5?
That would be possible, too. But actually the ...POST_COPROC stuff itself looks OK to me. It's just the "pdm360ng_coprocessor_post_test" part that needs to be replaced by a more generic name.
I mean, the implementations for lwmon5 and sysmon1 are not exactly elegant either, but at least they are a bit more generic.
Quoted 1 line
Anatolij, this should be straight forward.
That's what I thought, too.
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 Men will always be men -- no matter where they are. -- Harry Mudd, "Mudd's Women", stardate 1329.8
PATCH v3 3/3 mpc5121: pdm360ng: add coprocessor POST
In reply to Wolfgang DenkHello Wolfgang,
Quoted 23 lines · On Wed, 14 Apr 2010 17:40:16 +0200 Wolfgang Denk <[email protected]> wrote:
...
Quoted 22 lines
post/tests.c +9
-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 pdm360ng_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 , + &pdm360ng_coprocessor_post_test, + NULL,
Quoted 8 lines
post/tests.c struct post_test post_list[] = · line 302
Quoted 5 lines
post/tests.c +4
-0+ NULL, + CONFIG_SYS_POST_COPROC + } +#endif };I don't want to see board specific code (pdm360ng_*) in such a global file. Please use a more generic approach.
What would be a preferred way to realize this? Defining a weak function in post/post.c or post/tests.c which could be over-ridden by board specific one? Like:
int __post_coprocessor_post_test(int flags)
{
return 0;
}
int coprocessor_post_test(int flags)
__attribute__((weak, alias("__post_coprocessor_post_test")));Then I have to put board specific post code in board/pdm360ng/post.c to the pdm360ng.c file back. Otherwise the board's coprocessor_post_test() function is not linked if there is no other code in this post.c file which is strongly-linked.
Anatolij
PATCH v3 3/3 mpc5121: pdm360ng: add coprocessor POST
Dear Anatolij Gustschin,
Quoted 4 lines · In message <20100415122416.050f31a8@wker> you wrote:
What would be a preferred way to realize this? Defining a weak function in
post/post.corpost/tests.cwhich could be over-ridden by board specific one? Like:
This would eventually indeed allow for cleaner code, but then we should also clean up the existing lwmon5 and sysmon1 code in the same way. I don't want to urge you doing that, though.
For now I would also accept the code as is, just with a more generic function name.
Quoted 4 lines
Then I have to put board specific post code in
board/pdm360ng/post.cto thepdm360ng.cfile back. Otherwise the board'scoprocessor_post_test()function is not linked if there is no other code in thispost.cfile which is strongly-linked.
Actually board specific POST code should go to post/board/pdm360ng/
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 Backed up the system lately?
PATCH v3 2/3 mpc5121: add support for PDM360NG board
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 1 line · In message <[email protected]> you wrote:
PDM360NG is a MPC5121E based board by ifm ecomatic gmbh.
...
Quoted 3 lines
- don't use DDR RAM size config macro,
get_ram_size()is used now infixed_sdram()to determine RAM size (see previous patch 1/3)
With this change, can we then not also get rid of manually defining CONFIG_PDM360NG_BIG ? We should be able to auto-detect the configuration from the actual RAM size now, right?
Best regards,
Wolfgang Denk
Signature · 7 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 glory of creation is in its infinite diversity." "And in the way our differences combine to create meaning and beauty." -- Dr. Miranda Jones and Spock, "Is There in Truth No Beauty?", stardate 5630.8
PATCH v3 2/3 mpc5121: add support for PDM360NG board
Hello Wolfgang,
Quoted 10 lines · On Wed, 14 Apr 2010 17:48:40 +0200 Wolfgang Denk <[email protected]> wrote:
Quoted 1 line · In message <[email protected]> you wrote:
PDM360NG is a MPC5121E based board by ifm ecomatic gmbh.
...
Quoted 3 lines
- don't use DDR RAM size config macro,
get_ram_size()is used now infixed_sdram()to determine RAM size (see previous patch 1/3)With this change, can we then not also get rid of manually defining
CONFIG_PDM360NG_BIG? We should be able to auto-detect the configuration from the actual RAM size now, right?
But another configuration for 128 MB uses different values for DDR System Configuration Register and DDR Time Config[0-2] Registers. We still need this config option.
Best regards,
Anatolij
PATCH v3 2/3 mpc5121: add support for PDM360NG board
Hi Anatolij,
Quoted 7 lines · On Thursday 15 April 2010 14:32:14 Anatolij Gustschin wrote:
Quoted 3 lines
With this change, can we then not also get rid of manually defining
CONFIG_PDM360NG_BIG? We should be able to auto-detect the configuration from the actual RAM size now, right?But another configuration for 128 MB uses different values for DDR System Configuration Register and DDR Time Config[0-2] Registers. We still need this config option.
On some 4xx boards, we have a similar SDRAM size auto-detection, using different SDRAM controller setup's. It's done by first configuring the max. size config option and testing its memory size (get_ram_size()). If this size doesn't match the configured one (mirroring), then the next smaller config option is used. And so on. This way we can have one binary image supporting multiple SDRAM configurations.
I suggest you take a look at arch/ppc/cpu/ppc4xx/sdram.c:
sdram_conf_t mb0cf[] = {
{(128 << 20), 13, 0x000A4001}, /* (0-128MB) Address Mode 3, 13x10(4) */
{(64 << 20), 13, 0x00084001}, /* (0-64MB) Address Mode 3, 13x9(4) */
{(32 << 20), 12, 0x00062001}, /* (0-32MB) Address Mode 2, 12x9(4) */
{(16 << 20), 12, 0x00046001}, /* (0-16MB) Address Mode 4, 12x8(4) */
{(4 << 20), 11, 0x00008001}, /* (0-4MB) Address Mode 5, 11x8(2) */
};and initdram() where these struct is used.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: [email protected]
PATCH v3 2/3 mpc5121: add support for PDM360NG board
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 8 lines · In message <20100415143214.3e10813d@wker> you wrote:
Quoted 4 lines
With this change, can we then not also get rid of manually defining
CONFIG_PDM360NG_BIG? We should be able to auto-detect the configuration from the actual RAM size now, right?But another configuration for 128 MB uses different values for DDR System Configuration Register and DDR Time Config[0-2] Registers. We still need this config option.
Isn't there a way to auto-adjust these settings? On PowerPC, we routinely use get_ram_size() to test different sets of memory controller settings to auto-select the correct ones, allowing to use one single binary image for all memory configurations.
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 I have never understood the female capacity to avoid a direct answer to any question. -- Spock, "This Side of Paradise", stardate 3417.3
PATCH v3 1/3 mpc5121: determine RAM size using get_ram_size()
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 2 lines · In message <[email protected]> you wrote:
Configure 1GiB address range in DDR LAW and
determine the RAM size. Fix DDR LAW afterwards.
Why 1 GiB? Where is this linit coming from? It seems pretty artificial to me?
arch/ppc/cpu/mpc512x/fixed_sdram.c long int fixed_sdram(ddr512x_config_t *mddrc_config, · line 81
Quoted 2 lines
arch/ppc/cpu/mpc512x/fixed_sdram.c +1
-1-u32 msize =CONFIG_SYS_DDR_SIZE *1024 *1024 ; +u32 msize =1024 *1024 *1024 ;
I'd rather see a (#define'd) constant used here, espeaically as the vlue is used again furhter doewn in the code...
arch/ppc/cpu/mpc512x/fixed_sdram.c long int fixed_sdram(ddr512x_config_t *mddrc_config, · line 151
Quoted 7 lines
arch/ppc/cpu/mpc512x/fixed_sdram.c +1
-0u32 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 ,0x40000000 );
... i. e. here. Using two different notations for the same number makes the code even hearder to read and understand.
I suggest we use CONFIG_SYS_MAX_RAM_SIZE like we do in so many other boards, and leave it to the board maintainer to set a usefule default value.
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 "To IBM, 'open' means there is a modicum of interoperability among some of their equipment." - Harv Masterson
PATCH v3 1/3 mpc5121: determine RAM size using get_ram_size()
Hello Wolfgang,
Quoted 6 lines · On Wed, 14 Apr 2010 17:31:47 +0200 Wolfgang Denk <[email protected]> wrote:
Quoted 2 lines · In message <[email protected]> you wrote:
Configure 1GiB address range in DDR LAW and
determine the RAM size. Fix DDR LAW afterwards.Why 1 GiB? Where is this linit coming from? It seems pretty artificial to me?
It is the base address for NAND which is 0x40000000 (1GiB) for all mpc512x boards in the U-Boot tree. But now I see that it is also wrong as some boards use 0x30000000 for SRAM base. The upper limit is 2GiB.
Quoted 5 lines
arch/ppc/cpu/mpc512x/fixed_sdram.c long int fixed_sdram(ddr512x_config_t *mddrc_config, · line 81
Quoted 2 lines
arch/ppc/cpu/mpc512x/fixed_sdram.c +1
-1-u32 msize =CONFIG_SYS_DDR_SIZE *1024 *1024 ; +u32 msize =1024 *1024 *1024 ;I'd rather see a (#define'd) constant used here, espeaically as the vlue is used again furhter doewn in the code...
Will fix.
Quoted 6 lines
Quoted 6 lines
arch/ppc/cpu/mpc512x/fixed_sdram.c +0
-0u32 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);
Quoted 8 lines
arch/ppc/cpu/mpc512x/fixed_sdram.c long int fixed_sdram(ddr512x_config_t *mddrc_config, · line 151
Quoted 1 line
arch/ppc/cpu/mpc512x/fixed_sdram.c +1
-0+ msize =get_ram_size (CONFIG_SYS_DDR_BASE ,0x40000000 );... i. e. here. Using two different notations for the same number makes the code even hearder to read and understand.
I suggest we use
CONFIG_SYS_MAX_RAM_SIZElike we do in so many other boards, and leave it to the board maintainer to set a usefule default value.
Ok, I will submit next patch version with this fix. Thanks!
Best regards,
Anatolij
PATCH v2 5/7 mpc5121: add common post_word_load/store code
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 11 lines · In message <[email protected]> you wrote:
Add common post_word_load/post_word_store routines for all mpc5121 boards. pdm360ng board support added by subsequent patches needs these, as it adds a board specific POST test.
Signed-off-by Anatolij Gustschin <[email protected]>---
This patch is new in this series. This code was in board support file in v1 patch series. Now it is common for mpc512x boards.
Quoted 4 lines
cpu/mpc512x/Makefile | 1 + cpu/mpc512x/commproc.c | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 0 deletions(-) create mode 100644 cpu/mpc512x/commproc.c
Applied to "u-boot-mpc5xxx" repository. 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
Mr. Cole's Axiom:
The sum of the intelligence on the planet is a constant;
the population is growing.Wolfgang Denk
AppliedPATCH v2 4/7 fdt_support: add partitions fixup in mtd node
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 12 lines · In message <[email protected]> you wrote:
Allow overriding defined partitions in the device tree blob using partition info defined in the 'mtdparts' environment variable.
Signed-off-by Anatolij Gustschin <[email protected]>Cc Gerald Van Baren <[email protected]>---
Changes since first version:
- infdt_fixup_mtdparts()check the presence of "mtdparts" environment variable and don't proceed with initialisation if the variable is not defined (suppresses warning while booting).
Quoted 7 lines
common/cmd_mtdparts.c | 2 +- common/fdt_support.c | 219 +++++++++++++++++++++++++++++++++++++++++++ include/fdt_support.h | 2 + include/jffs2/load_kernel.h | 1 + include/mtd_node.h | 11 ++ 5 files changed, 234 insertions(+), 1 deletions(-) create mode 100644 include/mtd_node.h
Applied to "next" branch. Thanks.
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
I think there's a world market for about five computers.
-- attr. Thomas J. Watson (Chairman of the Board, IBM), 1943PATCH v2 3/7 mpc5121: add PSC serial communication routines
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 7 lines · In message <[email protected]> you wrote:
Signed-off-by Anatolij Gustschin <[email protected]>---
No changes since v1.cpu/mpc512x/serial.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++ include/serial.h | 7 ++++ 2 files changed, 94 insertions(+), 0 deletions(-)
Applied to "u-boot-mpc5xxx" repository. Thanks.
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
Die Scheu vor Verantwortung ist die Krankheit unserer Zeit.
-- Otto von BismarckPATCH v2 2/7 mpc512x: add multi serial PSC support
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 15 lines · In message <[email protected]> you wrote:
Extend mpc512x serial driver to support multiple PSC ports.
Supsequent patches for PDM360NG board support make use of this functionality by defining
CONFIG_SERIAL_MULTIin the board config file. Additionally the used PSC devices are specified by defining e.g.CONFIG_SYS_PSC1,CONFIG_SYS_PSC4andCONFIG_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)andINIT_PSC_SERIAL_STRUCTURE(N)macros incpu/mpc512x/serial.c. Additionally you have to add code for registering added devices inserial_initialise()incommon/serial.c.Signed-off-by Anatolij Gustschin <[email protected]>
Quoted 8 lines
---
No changes since v1.common/serial.c | 23 ++++ cpu/mpc512x/serial.c | 266 +++++++++++++++++++++++++++++++++++++----- include/asm-ppc/immap_512x.h | 108 +++++++++--------- include/serial.h | 8 ++ 4 files changed, 324 insertions(+), 81 deletions(-)
Applied to "u-boot-mpc5xxx" repository. Thanks.
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 Being schizophrenic is better than living alone.
PATCH v2 1/7 mpc512x: make MEM IO Control configuration a board config option
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 10 lines · In message <[email protected]> you wrote:
Signed-off-by Anatolij Gustschin <[email protected]>---
No changes since v1.cpu/mpc512x/fixed_sdram.c | 2 +- include/asm-ppc/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(-)
Applied to "u-boot-mpc5xxx" repository. 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 Death. Destruction. Disease. Horror. That's what war is all about. That's what makes it a thing to be avoided. -- Kirk, "A Taste of Armageddon", stardate 3193.0
v2 cover Add support for PDM360NG board
In reply to Anatolij GustschinDear Anatolij Gustschin,
Quoted 4 lines · In message <[email protected]> you wrote:
This patch series intend to support MPC5121e based PDM360NG board. Patches preceding the actual board support patch 6 prepare needed infrastructure for the PDM360NG board.
Argh... so I applied an old version of these patches. OK, I can still undo this; no damage done except wasted work and time.
To avoid this in the future please make sure to use proper threading when you resubmit a patch series - this new submission was in no way linked to your previous one. Thanks.
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 Quantum Mechanics is God's version of "Trust me."