[U-Boot] Pull request: u-boot-usb
The following changes since commit a43ea5cc6d612471fbc74f0a26b2bea5864aa1d6: Jon Smirl (1): .gitignore for generated files in api_examples directory are available in the git repository at: git://git.denx.de/u-boot-usb.git master Vivek Kutal (1): Replaced endpoint numbers with appropriate macros in usbtty.c. drivers/serial/usbtty.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/3] Three mpc5200 patches from Pengutronix.de
Three generic mpc5200 patches from Pengutronix.de that missed being submitted to mainline. --- Sascha Hauer (3): mpc5200: make i2c faster mpc52xx phy: initialize only when needed mpc5200: do not use printf in i2c_init() cpu/mpc5xxx/i2c.c | 16 +++- drivers/net/mpc5xxx_fec.c | 11 +-- 2 files changed, 12 insertions(+), 15 deletions(-) -- Jon Smirl jonsm...@gmail.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/3] mpc5200: do not use printf in i2c_init()
From: Sascha Hauer s.ha...@pengutronix.de On boards which have the environment in eeprom, i2c_init() is called before the console and ram is initialized. Do not printf here. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- cpu/mpc5xxx/i2c.c | 10 -- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c index 7d76274..843af9c 100644 --- a/cpu/mpc5xxx/i2c.c +++ b/cpu/mpc5xxx/i2c.c @@ -269,7 +269,6 @@ static int mpc_get_fdr(int speed) if (gd-flags GD_FLG_RELOC) { fdr = divider; } else { - printf(%ld kHz, , best_speed / 1000); return divider; } } @@ -310,29 +309,24 @@ int i2c_read(uchar chip, uint addr, int alen, uchar *buf, int len) xaddr[3] = addr 0xFF; if (wait_for_bb()) { - printf(i2c_read: bus is busy\n); goto Done; } mpc_reg_out(regs-mcr, I2C_STA, I2C_STA); if (do_address(chip, 0)) { - printf(i2c_read: failed to address chip\n); goto Done; } if (send_bytes(chip, xaddr[4-alen], alen)) { - printf(i2c_read: send_bytes failed\n); goto Done; } mpc_reg_out(regs-mcr, I2C_RSTA, I2C_RSTA); if (do_address(chip, 1)) { - printf(i2c_read: failed to address chip\n); goto Done; } if (receive_bytes(chip, (char *)buf, len)) { - printf(i2c_read: receive_bytes failed\n); goto Done; } @@ -354,23 +348,19 @@ int i2c_write(uchar chip, uint addr, int alen, uchar *buf, int len) xaddr[3] = addr 0xFF; if (wait_for_bb()) { - printf(i2c_write: bus is busy\n); goto Done; } mpc_reg_out(regs-mcr, I2C_STA, I2C_STA); if (do_address(chip, 0)) { - printf(i2c_write: failed to address chip\n); goto Done; } if (send_bytes(chip, xaddr[4-alen], alen)) { - printf(i2c_write: send_bytes failed\n); goto Done; } if (send_bytes(chip, (char *)buf, len)) { - printf(i2c_write: send_bytes failed\n); goto Done; } ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/3] mpc52xx phy: initialize only when needed
From: Sascha Hauer s.ha...@pengutronix.de Do not initialize phy on startup, instead initialize it when we actually need it. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- drivers/net/mpc5xxx_fec.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c index 0f1d1af..1876b76 100644 --- a/drivers/net/mpc5xxx_fec.c +++ b/drivers/net/mpc5xxx_fec.c @@ -42,6 +42,8 @@ typedef struct { int fec5xxx_miiphy_read(char *devname, uint8 phyAddr, uint8 regAddr, uint16 * retVal); int fec5xxx_miiphy_write(char *devname, uint8 phyAddr, uint8 regAddr, uint16 data); +static int mpc5xxx_fec_init_phy(struct eth_device *dev, bd_t * bis); + // #if (DEBUG 0x2) static void mpc5xxx_fec_phydump (char *devname) @@ -249,6 +251,8 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis) printf (mpc5xxx_fec_init... Begin\n); #endif + mpc5xxx_fec_init_phy(dev, bis); + /* * Initialize RxBD/TxBD rings */ @@ -387,6 +391,11 @@ static int mpc5xxx_fec_init_phy(struct eth_device *dev, bd_t * bis) { mpc5xxx_fec_priv *fec = (mpc5xxx_fec_priv *)dev-priv; const uint8 phyAddr = CONFIG_PHY_ADDR; /* Only one PHY */ + static int initialized = 0; + + if(initialized) + return 0; + initialized = 1; #if (DEBUG 0x1) printf (mpc5xxx_fec_init_phy... Begin\n); @@ -937,8 +946,6 @@ int mpc5xxx_fec_initialize(bd_t * bis) mpc5xxx_fec_set_hwaddr(fec, env_enetaddr); } - mpc5xxx_fec_init_phy(dev, bis); - return 1; } ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/3] mpc5200: make i2c faster
From: Sascha Hauer s.ha...@pengutronix.de The mpc5xxx i2c driver has great delays while waiting for the chip status. make the delays smaller and the driver faster. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- cpu/mpc5xxx/i2c.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c index 843af9c..41feb1d 100644 --- a/cpu/mpc5xxx/i2c.c +++ b/cpu/mpc5xxx/i2c.c @@ -38,7 +38,7 @@ DECLARE_GLOBAL_DATA_PTR; #error CONFIG_SYS_I2C_MODULE is not properly configured #endif -#define I2C_TIMEOUT100 +#define I2C_TIMEOUT1 #define I2C_RETRIES3 struct mpc5xxx_i2c_tap { @@ -94,7 +94,7 @@ static int wait_for_bb(void) mpc_reg_out(regs-mcr, 0, 0); mpc_reg_out(regs-mcr, I2C_EN, 0); #endif - udelay(1000); + udelay(1); status = mpc_reg_in(regs-msr); } @@ -109,7 +109,7 @@ static int wait_for_pin(int *status) *status = mpc_reg_in(regs-msr); while (timeout-- !(*status I2C_IF)) { - udelay(1000); + udelay(1); *status = mpc_reg_in(regs-msr); } ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Add define for mpc5200 CDM_CLK_ENA
Add define for mpc5200 CDM_CLK_ENA Signed-off-by: Jon Smirl jonsm...@gmail.com --- include/mpc5xxx.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/mpc5xxx.h b/include/mpc5xxx.h index 3a32821..6138d45 100644 --- a/include/mpc5xxx.h +++ b/include/mpc5xxx.h @@ -140,6 +140,7 @@ #define MPC5XXX_CDM_BRDCRMB(MPC5XXX_CDM + 0x0008) #define MPC5XXX_CDM_CFG(MPC5XXX_CDM + 0x000c) #define MPC5XXX_CDM_48_FDC (MPC5XXX_CDM + 0x0010) +#define MPC5XXX_CDM_CLK_ENA(MPC5XXX_CDM + 0x0014) #define MPC5XXX_CDM_SRESET (MPC5XXX_CDM + 0x0020) /* Local Plus Bus interface */ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] board support patch for phyCORE-MPC5200B-tiny
Add support for the Phytec phyCORE-MPC5200B-tiny. This code is from Pengutronix.de but they didn't sign the patch. I have updated it from u-boot 1.2 to work on u-boot master. Signed-off-by: Jon Smirl jonsm...@gmail.com Signed-off-by: Jon Smirl jonsm...@gmail.com --- Makefile | 16 + board/phycore_mpc5200b_tiny/Makefile | 50 ++ board/phycore_mpc5200b_tiny/config.mk | 43 ++ board/phycore_mpc5200b_tiny/mt46v32m16-75.h| 54 +++ .../phycore_mpc5200b_tiny/phycore_mpc5200b_tiny.c | 307 ++ board/phycore_mpc5200b_tiny/u-boot.lds | 123 ++ cpu/mpc5xxx/ide.c |3 include/configs/phycore_mpc5200b_tiny.h| 431 8 files changed, 1027 insertions(+), 0 deletions(-) create mode 100644 board/phycore_mpc5200b_tiny/Makefile create mode 100644 board/phycore_mpc5200b_tiny/config.mk create mode 100644 board/phycore_mpc5200b_tiny/mt46v32m16-75.h create mode 100644 board/phycore_mpc5200b_tiny/phycore_mpc5200b_tiny.c create mode 100644 board/phycore_mpc5200b_tiny/u-boot.lds create mode 100644 include/configs/phycore_mpc5200b_tiny.h diff --git a/Makefile b/Makefile index ba6a602..fe6dd5b 100644 --- a/Makefile +++ b/Makefile @@ -668,6 +668,22 @@ o2dnt_config: unconfig pf5200_config: unconfig @$(MKCONFIG) pf5200 ppc mpc5xxx pf5200 esd +phycore_mpc5200b_tiny_config \ +phycore_mpc5200b_tiny_LOWBOOT_config \ +phycore_mpc5200b_tiny_RAMBOOT_config: unconfig + @ include/config.h + @[ -z $(findstring LOWBOOT_,$@) ] || \ + { echo TEXT_BASE = 0xFF00 board/phycore_mpc5200b_tiny/config.tmp ; \ + echo ... with LOWBOOT configuration ; \ + } + @[ -z $(findstring RAMBOOT_,$@) ] || \ + { echo TEXT_BASE = 0x0010 board/phycore_mpc5200b_tiny/config.tmp ; \ + echo ... with RAMBOOT configuration ; \ + echo ... remember to make sure that MBAR is already switched to 0xF000 !!! ; \ + } + @$(MKCONFIG) -a phycore_mpc5200b_tiny ppc mpc5xxx phycore_mpc5200b_tiny + @ echo remember to set PHYCORE_MPC5200B_TINY_REV to 0 for rev 1245.0 rev or to 1 for rev 1245.1 + PM520_config \ PM520_DDR_config \ PM520_ROMBOOT_config \ diff --git a/board/phycore_mpc5200b_tiny/Makefile b/board/phycore_mpc5200b_tiny/Makefile new file mode 100644 index 000..22ce8e6 --- /dev/null +++ b/board/phycore_mpc5200b_tiny/Makefile @@ -0,0 +1,50 @@ +# +# (C) Copyright 2003-2007 +# Wolfgang Denk, DENX Software Engineering, w...@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 $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).a + +COBJS := $(BOARD).o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak $(obj).depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/phycore_mpc5200b_tiny/config.mk b/board/phycore_mpc5200b_tiny/config.mk new file mode 100644 index 000..e16959f --- /dev/null +++ b/board/phycore_mpc5200b_tiny/config.mk @@ -0,0 +1,43 @@ +# +# (C) Copyright 2003 +# Wolfgang Denk, DENX Software Engineering, w...@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
Re: [U-Boot] Pull request: u-boot-usb
Dear Remy Bohmer, In message 3efb10970903210257m75bde9d1neaacaddeaa029...@mail.gmail.com you wrote: The following changes since commit a43ea5cc6d612471fbc74f0a26b2bea5864aa1d6: Jon Smirl (1): .gitignore for generated files in api_examples directory are available in the git repository at: git://git.denx.de/u-boot-usb.git master Vivek Kutal (1): Replaced endpoint numbers with appropriate macros in usbtty.c. drivers/serial/usbtty.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Last minute... Applied, thanks. Best regards, Wolfgang Denk -- 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: w...@denx.de In C we had to code our own bugs, in C++ we can inherit them. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] mpc5200: do not use printf in i2c_init()
Dear Jon, In message 20090321133844.11905.61201.st...@localhost you wrote: From: Sascha Hauer s.ha...@pengutronix.de On boards which have the environment in eeprom, i2c_init() is called before the console and ram is initialized. Do not printf here. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- cpu/mpc5xxx/i2c.c | 10 -- 1 files changed, 0 insertions(+), 10 deletions(-) Rather than doing this unconsitionally, this change should only be implemented on boards which actually hold the envrionment in I2C EEPROM (alternatively, one should consider fixing these boards to use more appropriate storage; in addition to being not reliable, I2C EEPROM is slow - see http://www.denx.de/wiki/DULG/AN2004_11_BootTimeOptimization ) Best regards, Wolfgang Denk -- 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: w...@denx.de Bureaucracy is the enemy of innovation. - Mark Shepherd, former President and CEO of Texas Instruments ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/3] mpc5200: make i2c faster
Dear Jon, In message 20090321133848.11905.59350.st...@localhost you wrote: From: Sascha Hauer s.ha...@pengutronix.de The mpc5xxx i2c driver has great delays while waiting for the chip status. make the delays smaller and the driver faster. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- cpu/mpc5xxx/i2c.c |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Are you absolutely sure that reducing these delays from 1 millisecond to 1 microsecond will work on all boards with all currently supported devices? And how much do we make I2C faster this way? Where do we save time, and how much? Best regards, Wolfgang Denk -- 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: w...@denx.de It's certainly convenient the way the crime (or condition) of stupidity carries with it its own punishment, automatically admisistered without remorse, pity, or prejudice. :-) -- Tom Christiansen in 559seq$ag...@csnews.cs.colorado.edu ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM
Dear Jon, In message 20090321135934.12464.65400.st...@localhost you wrote: From: Eric Schumann e.schum...@phytec.de On the pcm030 the environment is located in the onboard EEPROM. But we want to handle flash sector protection in a safe manner. So we must read the unlock environment variable from EEPROM instead from flash. This patch is required as long the evironment is saved into the EEPROM. Signed-off-by: Eric Schumann e.schum...@phytec.de Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- 0 files changed, 0 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 391d169..1436131 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -2009,7 +2009,9 @@ unsigned long flash_init (void) #endif #ifdef CONFIG_SYS_FLASH_PROTECTION - char *s = getenv(unlock); + /* read environment from EEPROM */ + char s[4]; + getenv_r (unlock, s, sizeof(s)); #endif This patch doesn't really make sense to me. The flash_init() code is only being run after relocation to RAM, so standard getenv() is supposed to work, and there should be no reason why we would have to fall back on getenv_r(). Please explain which issues you are observing. Best regards, Wolfgang Denk -- 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: w...@denx.de Who is the oldest inhabitant of this village? We haven't got one; we had one, but he died three weeks ago. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM
On Sat, Mar 21, 2009 at 3:52 PM, Wolfgang Denk w...@denx.de wrote: Dear Jon, In message 20090321135934.12464.65400.st...@localhost you wrote: From: Eric Schumann e.schum...@phytec.de On the pcm030 the environment is located in the onboard EEPROM. But we want to handle flash sector protection in a safe manner. So we must read the unlock environment variable from EEPROM instead from flash. This patch is required as long the evironment is saved into the EEPROM. Signed-off-by: Eric Schumann e.schum...@phytec.de Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- 0 files changed, 0 insertions(+), 0 deletions(-) diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 391d169..1436131 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -2009,7 +2009,9 @@ unsigned long flash_init (void) #endif #ifdef CONFIG_SYS_FLASH_PROTECTION - char *s = getenv(unlock); + /* read environment from EEPROM */ + char s[4]; + getenv_r (unlock, s, sizeof(s)); #endif This patch doesn't really make sense to me. The flash_init() code is only being run after relocation to RAM, so standard getenv() is supposed to work, and there should be no reason why we would have to fall back on getenv_r(). I didn't write these, these are the Phytex pcm030 board support patches from Pengutronix that have never been submitted to mainline. They're all working on my hardware but of course there may be better ways to do things. My guess is getenv() returns a pointer to the environment variable, not a copy of the environment variable. getenv_r() returns a copy. How can you return a pointer to the variable if the variable is in something not directly addressable like EEPROM? Does getenv(unlock); do what you want when the environment is in EEPROM? Please explain which issues you are observing. Best regards, Wolfgang Denk -- 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: w...@denx.de Who is the oldest inhabitant of this village? We haven't got one; we had one, but he died three weeks ago. -- Jon Smirl jonsm...@gmail.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM
Dear Jon Smirl, In message 9e4733910903211308v63878fabx19f3327371db5...@mail.gmail.com you wrote: My guess is getenv() returns a pointer to the environment variable, not a copy of the environment variable. getenv_r() returns a copy. How can you return a pointer to the variable if the variable is in something not directly addressable like EEPROM? Does The environment always gets copied to RAM. And it's a perfectly simple thing to return an adress pointing to some memory in RAM :-) getenv(unlock); do what you want when the environment is in EEPROM? getenv() always works that way, no matter which actual media is used for the persistent storage of the environment. Best regards, Wolfgang Denk -- 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: w...@denx.de The only person who always got his work done by Friday was Robinson Crusoe. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM
On Sat, Mar 21, 2009 at 4:24 PM, Wolfgang Denk w...@denx.de wrote: Dear Jon Smirl, In message 9e4733910903211308v63878fabx19f3327371db5...@mail.gmail.com you wrote: My guess is getenv() returns a pointer to the environment variable, not a copy of the environment variable. getenv_r() returns a copy. How can you return a pointer to the variable if the variable is in something not directly addressable like EEPROM? Does The environment always gets copied to RAM. And it's a perfectly simple thing to return an adress pointing to some memory in RAM :-) getenv(unlock); do what you want when the environment is in EEPROM? getenv() always works that way, no matter which actual media is used for the persistent storage of the environment. This one can be dropped. It looks like a misunderstanding in how the API worked. Best regards, Wolfgang Denk -- 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: w...@denx.de The only person who always got his work done by Friday was Robinson Crusoe. -- Jon Smirl jonsm...@gmail.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] board support patch for phyCORE-MPC5200B-tiny
Dear Jon Smirl, In message 20090321182020.32596.55248.st...@localhost you wrote: Add support for the Phytec phyCORE-MPC5200B-tiny. This code is from Pengutronix.de but they didn't sign the patch. I have updated it from u-boot 1.2 to work on u-boot master. Signed-off-by: Jon Smirl jonsm...@gmail.com Signed-off-by: Jon Smirl jonsm...@gmail.com --- Makefile | 16 + board/phycore_mpc5200b_tiny/Makefile | 50 ++ board/phycore_mpc5200b_tiny/config.mk | 43 ++ board/phycore_mpc5200b_tiny/mt46v32m16-75.h| 54 +++ .../phycore_mpc5200b_tiny/phycore_mpc5200b_tiny.c | 307 ++ board/phycore_mpc5200b_tiny/u-boot.lds | 123 ++ cpu/mpc5xxx/ide.c |3 include/configs/phycore_mpc5200b_tiny.h| 431 8 files changed, 1027 insertions(+), 0 deletions(-) create mode 100644 board/phycore_mpc5200b_tiny/Makefile create mode 100644 board/phycore_mpc5200b_tiny/config.mk create mode 100644 board/phycore_mpc5200b_tiny/mt46v32m16-75.h create mode 100644 board/phycore_mpc5200b_tiny/phycore_mpc5200b_tiny.c create mode 100644 board/phycore_mpc5200b_tiny/u-boot.lds create mode 100644 include/configs/phycore_mpc5200b_tiny.h So this is the second PHYTEC board we're adding (after the imx31_phycore), and I think it's time to create a vendor directory for them - please prepare a board/phytec/ directory, move the existing imx31_phycore code there, and and then add your new code there, too. diff --git a/Makefile b/Makefile index ba6a602..fe6dd5b 100644 --- a/Makefile +++ b/Makefile @@ -668,6 +668,22 @@ o2dnt_config:unconfig pf5200_config: unconfig @$(MKCONFIG) pf5200 ppc mpc5xxx pf5200 esd +phycore_mpc5200b_tiny_config \ +phycore_mpc5200b_tiny_LOWBOOT_config \ +phycore_mpc5200b_tiny_RAMBOOT_config:unconfig + @ include/config.h + @[ -z $(findstring LOWBOOT_,$@) ] || \ + { echo TEXT_BASE = 0xFF00 board/phycore_mpc5200b_tiny/config.tmp ; \ + echo ... with LOWBOOT configuration ; \ + } + @[ -z $(findstring RAMBOOT_,$@) ] || \ + { echo TEXT_BASE = 0x0010 board/phycore_mpc5200b_tiny/config.tmp ; \ + echo ... with RAMBOOT configuration ; \ + echo ... remember to make sure that MBAR is already switched to 0xF000 !!! ; \ + } + @$(MKCONFIG) -a phycore_mpc5200b_tiny ppc mpc5xxx phycore_mpc5200b_tiny + @ echo remember to set PHYCORE_MPC5200B_TINY_REV to 0 for rev 1245.0 rev or to 1 for rev 1245.1 Please do not add that many make targets and such long code for a single board; restrict yourself to the typically used cases and omit cases that are needed only for debugging (RAMBOOT); also, please consider using shorter names - phycore_mpc5200b_tiny_LOWBOOT_config is 36 characters - that's a major PITA to type. index 000..e16959f --- /dev/null +++ b/board/phycore_mpc5200b_tiny/config.mk @@ -0,0 +1,43 @@ ... +# phyCORE-MPC5200B tiny board: +# +#Valid values for TEXT_BASE are: +# +#0xFFF0 boot high (standard configuration) +#0xFF00 boot low +#0x0010 boot from RAM (for testing only) +# + +sinclude $(TOPDIR)/board/$(BOARDDIR)/config.tmp + +ifndef TEXT_BASE +## Standard: boot high +TEXT_BASE = 0xFFF0 +## For testing: boot from RAM +## TEXT_BASE = 0x0010 +endif Please remove the dead code here. diff --git a/board/phycore_mpc5200b_tiny/phycore_mpc5200b_tiny.c b/board/phycore_mpc5200b_tiny/phycore_mpc5200b_tiny.c new file mode 100644 index 000..4e7674e --- /dev/null +++ b/board/phycore_mpc5200b_tiny/phycore_mpc5200b_tiny.c @@ -0,0 +1,307 @@ ... +#ifndef CONFIG_SYS_RAMBOOT +static void sdram_start (int hi_addr) +{ + long hi_addr_bit = hi_addr ? 0x0100 : 0; + + /* unlock mode register */ + *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x8000 | hi_addr_bit; + __asm__ volatile (sync); + + /* precharge all banks */ + *(vu_long *)MPC5XXX_SDRAM_CTRL = SDRAM_CONTROL | 0x8002 | hi_addr_bit; + __asm__ volatile (sync); Please use proper accessor functions (out_be32() etc.) to access device registers; then you can also omit the syncs [here and everywhere else]. ... +void init_ide_reset (void) +{ + debug (init_ide_reset\n); + + /* Configure PSC2_4 as GPIO output for ATA reset */ + *(vu_long *) MPC5XXX_WU_GPIO_ENABLE |= GPIO_PSC2_4; + *(vu_long *) MPC5XXX_WU_GPIO_DIR|= GPIO_PSC2_4; + /* Deassert reset */ + *(vu_long *) MPC5XXX_WU_GPIO_DATA_O |= GPIO_PSC2_4; Please use proper bit accessor functions (setbits_be32() etc.) to access device registers [here and everywhere else]. ... +void video_get_info_str (int line_number, char *info) +{ + if
Re: [U-Boot] [PATCH 1/3] mpc5200: do not use printf in i2c_init()
On Sat, Mar 21, 2009 at 3:47 PM, Wolfgang Denk w...@denx.de wrote: Dear Jon, In message 20090321133844.11905.61201.st...@localhost you wrote: From: Sascha Hauer s.ha...@pengutronix.de On boards which have the environment in eeprom, i2c_init() is called before the console and ram is initialized. Do not printf here. Signed-off-by: Sascha Hauer s.ha...@pengutronix.de --- cpu/mpc5xxx/i2c.c | 10 -- 1 files changed, 0 insertions(+), 10 deletions(-) Rather than doing this unconditionally, this change should only be implemented on boards which actually hold the envrionment in I2C EEPROM (alternatively, one should consider fixing these boards to use more appropriate storage; in addition to being not reliable, I2C EEPROM is slow - see http://www.denx.de/wiki/DULG/AN2004_11_BootTimeOptimization ) How about this instead? Is there a variable that indicates when the console is safe to use, if so I can adjust the macro. From: Jon Smirl jonsm...@gmail.com On boards which have the environment in eeprom, i2c_init() is called before the console and ram is initialized. Do not printf here. Signed-off-by: Jon Smirl jonsm...@gmail.com --- cpu/mpc5xxx/i2c.c |7 +++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/cpu/mpc5xxx/i2c.c b/cpu/mpc5xxx/i2c.c index 7d76274..40f1682 100644 --- a/cpu/mpc5xxx/i2c.c +++ b/cpu/mpc5xxx/i2c.c @@ -41,6 +41,13 @@ DECLARE_GLOBAL_DATA_PTR; #define I2C_TIMEOUT100 #define I2C_RETRIES3 +#ifdef CONFIG_ENV_IS_IN_EEPROM +/* On boards which have the environment in eeprom, i2c_init() + * is called before the console and ram is initialized. Do + * not printf here. */ +#define printf(format, arg...) do {} while (0) +#endif + struct mpc5xxx_i2c_tap { int scl2tap; int tap2tap; -- Jon Smirl jonsm...@gmail.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] mpc5200: do not use printf in i2c_init()
Dear Jon Smirl, In message 9e4733910903211339u60f5531cp7a9574f2d1ba2...@mail.gmail.com you wrote: How about this instead? Is there a variable that indicates when the console is safe to use, if so I can adjust the macro. gd-have_console Best regards, Wolfgang Denk -- 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: w...@denx.de Testing can show the presense of bugs, but not their absence. -- Edsger Dijkstra ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] mpc5200: do not use printf in i2c_init()
Dear Jon Smirl, In message 9e4733910903211339u60f5531cp7a9574f2d1ba2...@mail.gmail.com you wrote: How about this instead? Is there a variable that indicates when the console is safe to use, if so I can adjust the macro. BTW: you might want to compare with cpu/mpc8xx/i2c.c or cpu/ppc4xx/i2c.c Best regards, Wolfgang Denk -- 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: w...@denx.de Where people stand is not as important as which way they face. - Terry Pratchett Stephen Briggs, _The Discworld Companion_ ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot