Re: [U-Boot] [PATCH 0/2] arm nomadik: gpio and i2c
Hello Wolfgang, Wolfgang Denk wrote: Dear Heiko Schocher, In message 4a6422fc.6030...@invitel.hu you wrote: typedef struct gpio_adapter { int (*init_pin)(int pin); int (*set)(int pin, value); int (*get)(int pin); int (*dir)(int pin, int direction); int (*level)(int pin, int level); } int gpio_init(gpio_adapter *adap); int gpio_init_pin(pin); ? maybe with setting a marker, that this pin is initialized, so this can be checked in the above functions ... ? int gpio_set(pin, value); int gpio_get(pin); int gpio_dir(pin, dir); int gpio_level(pin, dir); What does level mean in this context? Yesterday, when I emailed with Alessandro, it looked like, if we call gpio_set(), we also set the direction to output, so I thought, it would be nice to have a function which really just sets the value. Now, I think, we should set the direction only with gpio_dir() (if output also set the value). And with gpio_set() we only set the output value, without switching the direction ... Or should we do allways a set direction, when calling gpio_set() ...? gpio_init_pin() and gpio_dir() seem to be redundant - or does pin initialization not include the setting of the direction (and, in case of an output pin, it's initial state) ? Yes, you are right, also redundant. gpio_get() returns the current state of the pin? Yep. gpio_set() returns the previous state of the pin? Or the new state? If it returns the new state, we could use value=1 to set a pin, value=0 to unset a pin, and value=-1 to just read it's value without changing it; then we could #define gpio_get(pin) gpio_set(pin,-1). Yes, thats a good point. bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] Add ntel PCIE PRO/1000 Network Driver support
Hi Roy, Roy Zang wrote: From: Roy Zang tie-fei.z...@freescale.com Based on Intel PRO/1000 Network Driver 7.3.20-k2 Add Intel E1000 PCIE card support. The following cards are added: INTEL_82571EB_COPPER INTEL_82571EB_FIBER, INTEL_82571EB_SERDES INTEL_82571EB_QUAD_COPPER INTEL_82571PT_QUAD_COPPER INTEL_82571EB_QUAD_FIBER INTEL_82571EB_QUAD_COPPER_LOWPROFILE INTEL_82571EB_SERDES_DUAL INTEL_82571EB_SERDES_QUAD INTEL_82572EI_COPPER INTEL_82572EI_FIBER INTEL_82572EI_SERDES INTEL_82572EI INTEL_82573E INTEL_82573E_IAMT INTEL_82573L INTEL_82546GB_QUAD_COPPER_KSP3 INTEL_80003ES2LAN_COPPER_DPT INTEL_80003ES2LAN_SERDES_DPT INTEL_80003ES2LAN_COPPER_SPT INTEL_80003ES2LAN_SERDES_SPT 82571EB_COPPER dual ports, 82572EI single port, 82572EI_COPPER single port PCIE cards and 82545EM_COPPER, 82541GI_LF pci cards are tested on P2020 board, MPC8536DS and MPC8544DS boards. Signed-off-by: Roy Zang tie-fei.z...@freescale.com I have no objections to any of the content. A few themes, though: 1. Please ensure that the multi-line comments are formatted correctly. Lines 2+ should have a space in the first character. 2. If you insist on including dead code (i.e. #if 0), please provide a comment on why it's there 3. I have a hard time believing that most of this is necessary. Sure it's a complicated chip and you're pulling it from Intel's driver, but 3000+ lines is too much. Please try to remove stuff that's not needed. regards, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/6] net: Kirkwood_egiga: forced interface speed config support
Jean-Christophe PLAGNIOL-VILLARD wrote: On 20:58 Thu 16 Jul , Prafulla Wadaskar wrote: By default Auto Negotiation is enabled for interface speed but on some platforms like RD6281A it does not work. If you want to forced program it to desired speed, this patch helps- Through this patch Auto negotiation can be disabled and desired interface speed can be configured This patch is tested on RD6281A Kirkwood board Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- drivers/net/kirkwood_egiga.c | 24 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/drivers/net/kirkwood_egiga.c b/drivers/net/kirkwood_egiga.c index 3c5db19..1dfd567 100644 --- a/drivers/net/kirkwood_egiga.c +++ b/drivers/net/kirkwood_egiga.c @@ -415,7 +415,31 @@ static int kwgbe_init(struct eth_device *dev) /* Assign port configuration and command. */ KWGBEREG_WR(regs-pxc, PRT_CFG_VAL); KWGBEREG_WR(regs-pxcx, PORT_CFG_EXTEND_VALUE); +/* + * Forced 10/100/1000BASE-T interface speed configuration + * By default Auto Negotiation of interface speed is enabled + * This can be forced disabled and desired speed can be configured + */ +#ifdef CONFIG_DIS_AUTO_NEG_SPEED_GMII +#if (!defined (CONFIG_PHY_SPEED) || (CONFIG_PHY_SPEED == _1000BASET)) Could you find a better config taht _1000BASET co Global configs for this type of thing are a bad idea (what if you want one interface @ 1000 and one @ 100? I guess this will have to do for now, but let's ensure that it's temporary. Best Regards, J. regards, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] arm nomadik: gpio and i2c
Hello Wolfgang, Wolfgang Denk wrote: Dear Heiko Schocher, In message 4a6437a7.40...@denx.de you wrote: Also, a board can have more then one gpio adapter, how we address such a case? How far do you want to take that? What about an I/O expander at the I2C bus? Hmmm.. good question ;-) But I don;t think it is not so exotic to have more than one gpio adapter on one board. On the suen3 plattform where I actually work, there are the CPU GPIO pins and GPIO pins over an I/O Expander used ... so it should be possible to have more than one gpio adapter I think. And to make such an I/O Expander gpio adapter should not so difficult ... and if we now really make such a gpio lib, it should support more than one adapter ... I like Alessandros suggestion for concatening such multiple adapters, see: http://lists.denx.de/pipermail/u-boot/2009-July/056949.html bye Heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/2] document network driver framework
On Tuesday 21 July 2009 01:09:11 Ben Warren wrote: Mike Frysinger wrote: Signed-off-by: Mike Frysinger vap...@gentoo.org --- Ben: some things to note: - i adopted Jean's proposed naming scheme in the CONFIG section Is this a generally-accepted naming convention? I personally think it's crap, and since there isn't a single driver that uses it yet, you might say this is a bit ahead of the curve. some style needed to be suggested, and what Jean proposed is better than what we have today (which is nothing) - i deprecated calling the driver-specific entry point xxx_initialization() in favor of xxx_register() because the former is way too confusing with everyone also having xxx_init() That may be so, but since there isn't a single driver that uses this naming convention, you're wishing something that ain't so. that's why i said should, deprecated current naming, and noted existing practice. if you agree with the proposal, it's easy enough to run sed on a few files to fix one function name. you agree with my comment that today's behavior is confusing even if you stare and bang on the code day in and day out ? it's even worse for the occasional observer ... -mike signature.asc Description: This is a digitally signed message part. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] - save the server's mac address...
Hi Robin, Robin Getz wrote: From: Robin Getz rg...@blackfin.uclinux.org Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :) This sets the env var serveraddr (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to addnetconsole=set bootargs $(bootargs) netconso...@$(ipaddr)/eth0,@$(serverip)/$(serveraddr) Signed-of-by: Robin Getz rg...@blackfin.uclinux.org --- Index: net/net.c === --- net/net.c (revision 1968) +++ net/net.c (working copy) Can you please re-submit using git tools? thanks, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] DHCP regression on 2009-06
Michael, Michael Zaidman wrote: Fixed the DHCP/BOOTP/RARP regression introduced in u-boot-2009.06 by initializing our IP addr to 0 in order to accept any IP addr assigned to us by the DHCP/BOOTP/RARP server. Ack-by: Robin Getz rg...@blackfin.uclinux.org Signed-off-by: Michael Zaidman michael.zaid...@gmail.com --- net/net.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/net/net.c b/net/net.c index 5637cf5..9bd3208 100644 --- a/net/net.c +++ b/net/net.c @@ -388,17 +388,20 @@ restart: #if defined(CONFIG_CMD_DHCP) case DHCP: BootpTry = 0; + NetOurIP = 0; DhcpRequest(); /* Basically same as BOOTP */ break; #endif case BOOTP: BootpTry = 0; + NetOurIP = 0; BootpRequest (); break; case RARP: RarpTry = 0; + NetOurIP = 0; RarpRequest (); break; #if defined(CONFIG_CMD_PING) Applied to net repo. thanks, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/6] net: Kirkwood_egiga: forced interface speed config support
Prafulla, Prafulla Wadaskar wrote: By default Auto Negotiation is enabled for interface speed but on some platforms like RD6281A it does not work. If you want to forced program it to desired speed, this patch helps- Through this patch Auto negotiation can be disabled and desired interface speed can be configured This patch is tested on RD6281A Kirkwood board Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- Applied to net repo. thanks, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/6] net: phy: bugfixes: mv88E61xx multichip addressing support
Prafulla, Prafulla Wadaskar wrote: With these fixes, this driver works properly for multi chip addressging mode Bugfixes: 1. Build error fixed for function mv88e61xx_busychk_multic-fixed 2. PHY dev address error detection- fixed 3. wrong busy bit was refered in function mv88e61xx_busychk -fixed 4. invalid data read ptr was refered for RD_PHY in case of multichip addressing mode -fixed The Multichip Address mode is tested with RD6281A board having MV88E6165 switch on it Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- Applied to net repo. thanks, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ppc4xx: Fixed compilation warning in 4xx_enet.c
Ben, On Tuesday 21 July 2009 07:55:30 Ben Warren wrote: Can I get an ACK from you on this? Sorry if you already did and I missed it. I thought that I already ack'ed it. But hey, I have more than one ;) Acked-by: Stefan Roese s...@denx.de Best regards, 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: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Bugfix: mpc512x_fec MII accesses fail after ethernet transfers
Thomas, Thomas Dörfler wrote: The mpc512x FEC network driver resets the FEC before transferring packets. With this reset, the FEC clears the previous setting of MII transfer speed. This patch ensures, that it is set again to a reasonable value after a FEC reset. Signed-off-by: Thomas Doerfler thomas.doerf...@embedded-brains.de -- diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c index fb2c19a..f3d76ba 100644 --- a/drivers/net/mpc512x_fec.c +++ b/drivers/net/mpc512x_fec.c @@ -446,6 +446,19 @@ static void mpc512x_fec_halt (struct eth_device *dev) * wait at least 16 clock cycles */ udelay (10); + /* +* NOTE: reset will also clear the MII speed register +* we should reinitialize it ASAP +*/ + if (fec-xcv_type != SEVENWIRE) { + /* +* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock +* and do not drop the Preamble. +*/ + fec-eth-mii_speed = gd-ips_clk / 100) / 5) + + 1) + 1); + } #if (DEBUG 0x3) printf (Ethernet task stopped\n); #endif Applied to net repo (after some tweaking) thanks, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] ppc4xx: Fixed compilation warning in 4xx_enet.c
Stefan Roese wrote: Ben, On Tuesday 21 July 2009 07:55:30 Ben Warren wrote: Can I get an ACK from you on this? Sorry if you already did and I missed it. I thought that I already ack'ed it. But hey, I have more than one ;) You probably did, but it got lost somewhere in my mountain of e-mails. thanks, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] arm nomadik: gpio and i2c
Dear Heiko Schocher, In message 4a655c25.8080...@denx.de you wrote: And with gpio_set() we only set the output value, without switching the direction ... Right. Or should we do allways a set direction, when calling gpio_set() ...? This makes no sense to me. 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 A little suffering is good for the soul. -- Kirk, The Corbomite Maneuver, stardate 1514.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] powerpc: updates for the keymile boards
Dear Heiko Schocher, In message 4a654608.8010...@denx.de you wrote: ... so, if actual compiling the kmeter1, I get a compile error, following patch solves it: Yeah, saw this,t oo, in the nightly build results. [PATCH] 83xx, kmeter: fix compile error CONFIG_SYS_MALLOC_LEN is defined in the board config, and the keymile-common.h, which collects common options used by all keymile-boards. This results in a compile error when compiling the kmeter1 board. So remove this define in the board config file. Signed-off-by: Heiko Schocher h...@denx.de --- include/configs/kmeter1.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) Thanks, applied. 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 Any excuse will serve a tyrant. - Aesop ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3] Move api_examples to examples/api
Dear Peter Tyser, In message 1248134541-25601-1-git-send-email-pty...@xes-inc.com you wrote: Also add a rule to remove demo.bin which was previously leftover after a make clean Signed-off-by: Peter Tyser pty...@xes-inc.com --- Changes since v2: - Clean up demo.bin - rebased Makefile|5 +++-- {api_examples = examples/api}/.gitignore |0 {api_examples = examples/api}/Makefile |8 {api_examples = examples/api}/crt0.S |0 {api_examples = examples/api}/demo.c |0 {api_examples = examples/api}/glue.c |0 {api_examples = examples/api}/glue.h |0 {api_examples = examples/api}/libgenwrap.c |0 8 files changed, 7 insertions(+), 6 deletions(-) rename {api_examples = examples/api}/.gitignore (100%) rename {api_examples = examples/api}/Makefile (91%) rename {api_examples = examples/api}/crt0.S (100%) rename {api_examples = examples/api}/demo.c (100%) rename {api_examples = examples/api}/glue.c (100%) rename {api_examples = examples/api}/glue.h (100%) rename {api_examples = examples/api}/libgenwrap.c (100%) 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 Landru! Guide us! -- A Beta 3-oid, The Return of the Archons, stardate 3157.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Pull request - net
Wolfgang, The following changes since commit 1bc1538613d66cef3cbce680fc8d7c3561a0fbd0: Peter Tyser (1): Move examples/ to examples/standalone are available in the git repository at: git://git.denx.de/u-boot-net.git master Alessio Centazzo (1): ppc4xx: Fixed compilation warning in 4xx_enet.c Andreas Pretzsch (1): smc911x: add support for LAN9221 Ben Warren (2): Add warning about upcoming removal of old Ethernet API Convert SMC911X Ethernet driver to CONFIG_NET_MULTI API David Brownell (1): rm9200 ethernet driver: board-specific quirk (csb337) Kim Phillips (1): net: tsec - fix dereferencing type-punned pointer will break strict-aliasing rules warning Kumar Gala (1): uec: Fix compile warning Michael Zaidman (1): DHCP regression on 2009-06 Mike Frysinger (1): net: rename NetRxPkt to NetRxPacket Nobuhiro Iwamatsu (1): sh: sh_eth: Remove garbage from printf Poonam Aggrwal (1): P2020RDB Added support of Vitesse PHYs VSC8641(RGMII) and VSC8221(SGMII) Prafulla Wadaskar (2): net: phy: bugfixes: mv88E61xx multichip addressing support net: Kirkwood_egiga: forced interface speed config support Richard Retanubun (1): MIIPHYBB: Return 0x if the PHY is not asserting TA. Robin Getz (1): Add DNS support Simon Kagstrom (2): arm: Kirkwood: Fix compiler optimization bug for kwgbe_send arm: Kirkwood: Check the error summary bit for error detection Thomas Dörfler (1): Bugfix: mpc512x_fec MII accesses fail after ethernet transfers board/bf548-ezkit/bf548-ezkit.c |8 ++ board/cm-bf548/cm-bf548.c | 10 ++ board/freescale/mx31pdk/mx31pdk.c | 10 ++ board/imx31_litekit/imx31_litekit.c | 10 ++ board/imx31_phycore/imx31_phycore.c | 10 ++ board/micronas/vct/ebi_smc911x.c| 22 +++- board/micronas/vct/vct.c| 10 ++ board/omap3/evm/evm.c | 10 ++ board/renesas/ap325rxa/ap325rxa.c | 10 ++ board/renesas/rsk7203/rsk7203.c | 17 +++- common/cmd_net.c| 49 cpu/arm920t/at91rm9200/ether.c | 22 +++- doc/README.dns | 64 +++ drivers/net/4xx_enet.c |3 +- drivers/net/Makefile|2 +- drivers/net/kirkwood_egiga.c| 57 -- drivers/net/kirkwood_egiga.h|1 + drivers/net/mpc512x_fec.c | 13 ++ drivers/net/phy/miiphybb.c |7 + drivers/net/phy/mv88e61xx.c | 18 ++-- drivers/net/phy/mv88e61xx.h |2 +- drivers/net/sh_eth.c|2 +- drivers/net/smc911x.c | 177 - drivers/net/smc911x.h | 170 +++- drivers/net/tsec.c | 57 +- include/configs/ap325rxa.h |7 +- include/configs/bf548-ezkit.h |7 +- include/configs/cm-bf548.h |7 +- include/configs/imx31_litekit.h |7 +- include/configs/imx31_phycore.h |7 +- include/configs/mx31pdk.h |7 +- include/configs/omap3_evm.h |7 +- include/configs/rsk7203.h |7 +- include/configs/vct.h |9 +- include/net.h |9 +- include/netdev.h|2 + net/Makefile|7 +- net/bootp.c |2 +- net/dns.c | 211 +++ net/dns.h | 39 +++ net/eth.c |2 + net/net.c | 40 ++- 42 files changed, 902 insertions(+), 236 deletions(-) create mode 100644 doc/README.dns create mode 100644 net/dns.c create mode 100644 net/dns.h regards, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/6] net: Kirkwood_egiga: forced interface speed config support
Dear Ben Warren, In message 4a655eaa.4000...@gmail.com you wrote: By default Auto Negotiation is enabled for interface speed but on some platforms like RD6281A it does not work. What exactly is the reason that it doesn't work? Is it some deficiency of the board hardware that always exaists, or a problem only present in combination with certain switches. or what exactly? If you want to forced program it to desired speed, this patch helps- Through this patch Auto negotiation can be disabled and desired interface speed can be configured I'm not sure if it's really a good idea to do hard-code this as a compile-time option. +#if (!defined (CONFIG_PHY_SPEED) || (CONFIG_PHY_SPEED == _1000BASET)) Could you find a better config taht _1000BASET co Global configs for this type of thing are a bad idea (what if you want one interface @ 1000 and one @ 100? I guess this will have to do for now, but let's ensure that it's temporary. I am not convinced that such a patch should go in at all. Foir the boards that really need such a configuration, it should be possible to set this for example using a standard mii command as part of a preboot environment setting. This way the user can disable it at runtime (if he doesn;t need it), and we don't need to change the code. 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 Go to Heaven for the climate, Hell for the company.- Mark Twain ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/6] net: Kirkwood_egiga: forced interface speed config support
Dear Ben Warren, In message 4a656563.9020...@gmail.com you wrote: Prafulla Wadaskar wrote: By default Auto Negotiation is enabled for interface speed but on some platforms like RD6281A it does not work. If you want to forced program it to desired speed, this patch helps- Through this patch Auto negotiation can be disabled and desired interface speed can be configured This patch is tested on RD6281A Kirkwood board Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- Applied to net repo. Please reconsider - see my previous comment. [Sorry it came so late.] 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 You're too beautiful to ignore. Too much woman. -- Kirk to Yeoman Rand, The Enemy Within, stardate unknown ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 5/6] net: Kirkwood_egiga: forced interface speed config support
Wolfgang Denk wrote: Dear Ben Warren, In message 4a656563.9020...@gmail.com you wrote: Prafulla Wadaskar wrote: By default Auto Negotiation is enabled for interface speed but on some platforms like RD6281A it does not work. If you want to forced program it to desired speed, this patch helps- Through this patch Auto negotiation can be disabled and desired interface speed can be configured This patch is tested on RD6281A Kirkwood board Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- Applied to net repo. Please reconsider - see my previous comment. [Sorry it came so late.] Best regards, Wolfgang Denk No problem. I assumed it was a chip erratum but should have looked closer. Let's wait for Prafulla's response. regards, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Bugfix: mpc512x_fec MII accesses fail after ethernet transfers
Dear Ben Warren, In message 4a6565d4.7050...@gmail.com you wrote: Thomas Dörfler wrote: The mpc512x FEC network driver resets the FEC before transferring packets. With this reset, the FEC clears the previous setting of MII transfer speed. This patch ensures, that it is set again to a reasonable value after a FEC reset. Signed-off-by: Thomas Doerfler thomas.doerf...@embedded-brains.de -- diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c index fb2c19a..f3d76ba 100644 --- a/drivers/net/mpc512x_fec.c +++ b/drivers/net/mpc512x_fec.c @@ -446,6 +446,19 @@ static void mpc512x_fec_halt (struct eth_device *dev) * wait at least 16 clock cycles */ udelay (10); + /* +* NOTE: reset will also clear the MII speed register +* we should reinitialize it ASAP +*/ + if (fec-xcv_type != SEVENWIRE) { + /* +* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock +* and do not drop the Preamble. +*/ + fec-eth-mii_speed = gd-ips_clk / 100) / 5) + + 1) + 1); + } #if (DEBUG 0x3) printf (Ethernet task stopped\n); #endif Applied to net repo (after some tweaking) Sorry Ben, but I am not convinced that this is a good way to address the problem. Please see the previous discussion of this patch. I think it is perfectly reasonable that mpc512x_fec_halt() also disables the MII clock. After all, when the network intrface is stopped, there is no need that the clocks keep running and drawing current on battery powered devices. I'd rather see that the MII clock gets only started when needed, i. e. before running any MII commands. 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 I've already got a female to worry about. Her name is the Enterprise. -- Kirk, The Corbomite Maneuver, stardate 1514.0 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Bugfix: mpc512x_fec MII accesses fail after ethernet transfers
Wolfgang Denk wrote: Dear Ben Warren, In message 4a6565d4.7050...@gmail.com you wrote: Thomas Dörfler wrote: The mpc512x FEC network driver resets the FEC before transferring packets. With this reset, the FEC clears the previous setting of MII transfer speed. This patch ensures, that it is set again to a reasonable value after a FEC reset. Signed-off-by: Thomas Doerfler thomas.doerf...@embedded-brains.de -- diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c index fb2c19a..f3d76ba 100644 --- a/drivers/net/mpc512x_fec.c +++ b/drivers/net/mpc512x_fec.c @@ -446,6 +446,19 @@ static void mpc512x_fec_halt (struct eth_device *dev) * wait at least 16 clock cycles */ udelay (10); + /* +* NOTE: reset will also clear the MII speed register +* we should reinitialize it ASAP +*/ + if (fec-xcv_type != SEVENWIRE) { + /* +* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock +* and do not drop the Preamble. +*/ + fec-eth-mii_speed = gd-ips_clk / 100) / 5) + + 1) + 1); + } #if (DEBUG 0x3) printf (Ethernet task stopped\n); #endif Applied to net repo (after some tweaking) Sorry Ben, but I am not convinced that this is a good way to address the problem. Please see the previous discussion of this patch. I think it is perfectly reasonable that mpc512x_fec_halt() also disables the MII clock. After all, when the network intrface is stopped, there is no need that the clocks keep running and drawing current on battery powered devices. I'd rather see that the MII clock gets only started when needed, i. e. before running any MII commands. Best regards, Wolfgang Denk Yikes, sorry again. I saw the one where you said 'thanks for the explanation, I can reproduce...' Better hold off on my pull request :) Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Bugfix: mpc512x_fec MII accesses fail after ethernet transfers
Wolfgang Denk wrote: Dear Ben Warren, In message 4a6565d4.7050...@gmail.com you wrote: Thomas Dörfler wrote: The mpc512x FEC network driver resets the FEC before transferring packets. With this reset, the FEC clears the previous setting of MII transfer speed. This patch ensures, that it is set again to a reasonable value after a FEC reset. Signed-off-by: Thomas Doerfler thomas.doerf...@embedded-brains.de -- diff --git a/drivers/net/mpc512x_fec.c b/drivers/net/mpc512x_fec.c index fb2c19a..f3d76ba 100644 --- a/drivers/net/mpc512x_fec.c +++ b/drivers/net/mpc512x_fec.c @@ -446,6 +446,19 @@ static void mpc512x_fec_halt (struct eth_device *dev) * wait at least 16 clock cycles */ udelay (10); + /* +* NOTE: reset will also clear the MII speed register +* we should reinitialize it ASAP +*/ + if (fec-xcv_type != SEVENWIRE) { + /* +* Set MII_SPEED = (1/(mii_speed * 2)) * System Clock +* and do not drop the Preamble. +*/ + fec-eth-mii_speed = gd-ips_clk / 100) / 5) + + 1) + 1); + } #if (DEBUG 0x3) printf (Ethernet task stopped\n); #endif Applied to net repo (after some tweaking) Sorry Ben, but I am not convinced that this is a good way to address the problem. Please see the previous discussion of this patch. I think it is perfectly reasonable that mpc512x_fec_halt() also disables the MII clock. After all, when the network intrface is stopped, there is no need that the clocks keep running and drawing current on battery powered devices. I'd rather see that the MII clock gets only started when needed, i. e. before running any MII commands. Best regards, Wolfgang Denk Yikes, sorry again. I saw the one where you said 'thanks for the explanation, I can reproduce...' Better hold off on my pull request :) On that note, I'm off to bed. Hopefully the brain is better engaged tomorrow. Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Pull request - net
Dear Ben Warren, In message 4a656de2.1080...@gmail.com you wrote: Wolfgang, The following changes since commit 1bc1538613d66cef3cbce680fc8d7c3561a0fbd0: Peter Tyser (1): Move examples/ to examples/standalone are available in the git repository at: git://git.denx.de/u-boot-net.git master Alessio Centazzo (1): ppc4xx: Fixed compilation warning in 4xx_enet.c Andreas Pretzsch (1): smc911x: add support for LAN9221 Ben Warren (2): Add warning about upcoming removal of old Ethernet API Convert SMC911X Ethernet driver to CONFIG_NET_MULTI API David Brownell (1): rm9200 ethernet driver: board-specific quirk (csb337) Kim Phillips (1): net: tsec - fix dereferencing type-punned pointer will break strict-aliasing rules warning Kumar Gala (1): uec: Fix compile warning Michael Zaidman (1): DHCP regression on 2009-06 Mike Frysinger (1): net: rename NetRxPkt to NetRxPacket Nobuhiro Iwamatsu (1): sh: sh_eth: Remove garbage from printf Poonam Aggrwal (1): P2020RDB Added support of Vitesse PHYs VSC8641(RGMII) and VSC8221(SGMII) Prafulla Wadaskar (2): net: phy: bugfixes: mv88E61xx multichip addressing support net: Kirkwood_egiga: forced interface speed config support Richard Retanubun (1): MIIPHYBB: Return 0x if the PHY is not asserting TA. Robin Getz (1): Add DNS support Simon Kagstrom (2): arm: Kirkwood: Fix compiler optimization bug for kwgbe_send arm: Kirkwood: Check the error summary bit for error detection Thomas Dörfler (1): Bugfix: mpc512x_fec MII accesses fail after ethernet transfers I would like not to include net: Kirkwood_egiga: forced interface speed config support yet - not until it is clear if this is really needed as a hard-coded, compile-time selected option. And I disagree with the implementation of Bugfix: mpc512x_fec MII accesses fail after ethernet transfers 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 C++ was an interesting and valuable experiment, but we've learned its lessons and it's time to move on. - Peter Curran in dcqm4z@isgtec.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] ppc4xx: Add GDsys CompactCenter board support.
Hi, Stefan Stefan Roese wrote: Felix, On Wednesday 15 July 2009 11:24:07 Felix Radensky wrote: I think my first patch that open-coded part of ft_board_setup() related to EBC ranges was correct and tested on real hardware. I admit that I didn't test the second version of the patch, as I didn't have the hardware at hand. I'll submit a fix soon, but I still don't have hardware for testing, so I'd appreciate your help with that. Any news on this issue? Would be great if you could find the time to submit a patch for this. Dirk (?) and I will do the testing. The problem with approach you suggest (copy ranges array, modify first entry, rewrite ranges array), is that ranges property doesn't cover all chip selects, only populated ones, and NOR is not always on CS0 (in case of boot from NAND). So you don't really know which entry should be modified. Do you have any other ideas how to do this elegantly, without copying code from generic ft_board_setup() ? Felix. Felix. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] zlib: updated to v.1.2.3
Hi Wolfgang, I fixed patch and sent it to the mailing list. It is now waiting for moderation due to its size. Many thanks and regards, Giuseppe -Original Message- From: Wolfgang Denk [mailto:w...@denx.de] Sent: Monday, July 20, 2009 11:54 PM To: Giuseppe CONDORELLI Cc: u-boot@lists.denx.de Subject: Re: [U-Boot] [PATCH] zlib: updated to v.1.2.3 Dear Giuseppe CONDORELLI, In message 20090720213352.186e3832e...@gemini.denx.de I wrote: Dear Giuseppe CONDORELLI, In message 1246273458-19028-1-git-send-email-giuseppe.condore...@st.com you wrote: This patch updates zlib to the latest stable version. Only relevant zlib parts were ported to u-boot tree, as already did for the current zlib (0.95). New zlib guarantees a faster inflate performances other then others improvements as explained at www.zlib.net Signed-off-by: Giuseppe Condorelli giuseppe.condore...@st.com --- include/u-boot/zlib.h | 718 ++--- lib_generic/zlib.c| 3930 + 2 files changed, 2463 insertions(+), 2185 deletions(-) Applied, thanks. Stope. I backed out your patch as it is causing compile problems. It seems you did not do basic testing like running MAKEALL: ... Configuring for netstar board... /home/wd/git/u-boot/work/lib_generic/crc32.c:157: error: conflicting types for 'crc32' /home/wd/git/u-boot/work/include/u-boot/zlib.h:667: error: previous declaration of 'crc32' was here make[1]: *** [crc32.o] Error 1 Please fix and resubmit. 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 Man is the best computer we can put aboard a spacecraft ... and the only one that can be mass produced with unskilled labor. -- Wernher von Braun ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Refresh LZMA-lib to v4.65 (v2)
___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] help: Can't enter thee lowlevel_init.S?
HI: i port the uboot-2009.06 to arm2440 recently. the program is dead when execute the bl lowlevel_init in start.S, even i put the bl lowlevel_init in the almost first line of start.S, it is dead too. it seems like something wrong with the label lowlevel_init, but bl red_LED_on works fine. can anybody tell me why? this is all i use: Compile: arm-linux-gcc-4.3.2, arm2440 develop board, u-boot:2009.06 thanks and sorry about my english! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Refresh LZMA-lib to v4.65 (v3 resend)
___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] arm: pRAM support?
Hello, We are using the pRAM feature (CONFIG_PRAM) on the PPC architecture. As we are switching to an ARM architecture (Kirkwood) I am wondering if there is an equivalent U-Boot feature for this (CONFIG_PRAM did not work). /Andreas ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] Refresh LZMA-lib to 4.65
Dear Wolfgang, Sorry for my silence, but in the last time I have too things in my agenda. I sent again the patch with the required fix but you need to approve my mail because it is very huge. Thanks and best regards, luigi Il lunedì 20 luglio 2009 23:46:32 Wolfgang Denk ha scritto: Dear Luigi 'Comio' Mantellini, In message 1246985548-24183-1-git-send-email-luigi.mantellini...@gmail.com you wrote: --===1785671948== From: Luigi 'Comio' Mantellini luigi.mantell...@idf-hit.com --- common/cmd_bootm.c |5 +- include/lzma/LzmaDec.h | 31 + include/lzma/LzmaDecode.h | 31 - include/lzma/LzmaTools.h |2 +- include/lzma/LzmaTypes.h | 15 +- lib_generic/lzma/LGPL.txt | 502 -- lib_generic/lzma/LzmaDec.c | 1007 + lib_generic/lzma/LzmaDec.h | 223 +++ lib_generic/lzma/LzmaDecode.c | 584 - lib_generic/lzma/LzmaDecode.h | 113 lib_generic/lzma/LzmaTools.c | 164 +++--- lib_generic/lzma/LzmaTools.h |4 +- lib_generic/lzma/LzmaTypes.h | 45 -- lib_generic/lzma/Makefile |4 +- lib_generic/lzma/README.txt|8 +- lib_generic/lzma/Types.h | 208 ++ lib_generic/lzma/history.txt | 434 +++-- lib_generic/lzma/import_lzmasdk.sh |8 +- lib_generic/lzma/lzma.txt | 1257 +--- 19 files changed, 2398 insertions(+), 2247 deletions(-) create mode 100644 include/lzma/LzmaDec.h delete mode 100644 include/lzma/LzmaDecode.h delete mode 100644 lib_generic/lzma/LGPL.txt create mode 100644 lib_generic/lzma/LzmaDec.c create mode 100644 lib_generic/lzma/LzmaDec.h delete mode 100644 lib_generic/lzma/LzmaDecode.c delete mode 100644 lib_generic/lzma/LzmaDecode.h delete mode 100644 lib_generic/lzma/LzmaTypes.h create mode 100644 lib_generic/lzma/Types.h Are you going to resend an updated version of this patch any time soon so it can go into this upcoming release? Thanks in advance. Best regards, Wolfgang Denk -- Luigi Mantellini RD - Software Industrie Dial Face S.p.A. Via Canzo, 4 20068 Peschiera Borromeo (MI) Italy Tel.: +39 02 5167 2813 Fax: +39 02 5167 2459 E-mail: luigi.mantell...@idf-hit.com ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] mpc83xx: Add esd VME8349 board support
Kim, On Thursday 11 June 2009 17:15:48 Kim Phillips wrote: On Wed, 10 Jun 2009 19:09:48 +0200 Stefan Roese s...@denx.de wrote: From: Reinhard Arlt reinhard.a...@esd-electronics.com From: Reinhard Arlt reinhard.a...@esd-electronics.com This patch adds support for the esd VME8349 board equipped with the MPC8349. It's a VME PMC carrier board equipped with the Tundra TSI148 VME-bridge. Signed-off-by: Reinhard Arlt reinhard.a...@esd-electronics.com Signed-off-by: Stefan Roese s...@denx.de --- MAINTAINERS |2 + MAKEALL |1 + Makefile|2 + board/esd/vme8349/Makefile | 49 board/esd/vme8349/aduc.c| 522 +++ board/esd/vme8349/caddy.c | 203 ++ board/esd/vme8349/caddy.h | 78 ++ board/esd/vme8349/config.mk | 27 ++ board/esd/vme8349/pci.c | 409 +++ board/esd/vme8349/vme8349.c | 129 + drivers/pci/pci_auto.c |2 + include/configs/vme8349.h | 638 +++ might want to add a doc/README.vme8349 at some point. Currently not planned. I have to admit that I usually don't add such a readme. It's not an evaluation board after all. +++ b/board/esd/vme8349/Makefile @@ -0,0 +1,49 @@ +# +# Copyright (c) 2009 esd gmbh hannover germany. I sincerely doubt esd wrote this file from scratch - please retain original copyrights. OK, will do. +++ b/board/esd/vme8349/aduc.c @@ -0,0 +1,522 @@ +/* + * aduc.c -- esd VME8349 board support for aduc848 monitor. + * Copyright (c) 2008-2009 esd gmbh. + * + * Reinhard Arlt reinhard.a...@esd-electronics.com + * Based on board/mpc8349emds/mpc8349emds.c (and previous 834x releases.) this suggests a similar comment to mine above...and, er...there were no 'previous 834x releases' -- that was the first (it was renamed from ads). Now it'sunder board/freescale, btw. This file written from scratch. Only the copyright header was copied. I'll clean up the header in the next version. +static uint8_t aduc_execute_long(uint8_t par0, uint8_t par1, uint8_t cmd, uint32_t timeout) +{ + uint32_t l; + unsigned char cmmd[8]; + + cmmd[0] = 0; + cmmd[1] = 3; + cmmd[2] = par0; + cmmd[3] = par1; + cmmd[4] = cmd; + + if (i2c_write(0x78, 0x40, 1, (unsigned char *)cmmd, 5) != 0) { too many magic numbers...please use macros to define these constants. All your comments to this file are valid remarks. Thanks. This file was work- in-progress at the time I first published the patches. I'll remove this file in the next version. It will be added when its finally finished. snip diff --git a/board/esd/vme8349/caddy.c b/board/esd/vme8349/caddy.c + while (ctrlc() == 0) { + if (caddy_interface-cmd_in != caddy_interface-cmd_out) { + CADDY_CMD *caddy_cmd; + uint32_t result[5]; + uint16_t data16; + uint8_tdata8; + uint32_t status; + pci_dev_t dev; regroup, don't align. would it be easier to read if these were at the top level of the function (here and elsewhere)? OK, will change. + result[0] = 0; + result[1] = 0; + result[2] = 0; + result[3] = 0; + result[4] = 0; memset? Yes. +U_BOOT_CMD( + caddy, 2, 0, do_caddy, + Start Caddy server., + Start Caddy server with Data structure a given addr\n + ); diff --git a/board/esd/vme8349/caddy.h b/board/esd/vme8349/caddy.h +typedef enum { + CADDY_CMD_IO_READ_8, + CADDY_CMD_IO_READ_16, + CADDY_CMD_IO_READ_32, + CADDY_CMD_IO_WRITE_8, + CADDY_CMD_IO_WRITE_16, + CADDY_CMD_IO_WRITE_32, + CADDY_CMD_CONFIG_READ_8, + CADDY_CMD_CONFIG_READ_16, + CADDY_CMD_CONFIG_READ_32, + CADDY_CMD_CONFIG_WRITE_8, + CADDY_CMD_CONFIG_WRITE_16, + CADDY_CMD_CONFIG_WRITE_32, +} CADDY_CMDS; + + +typedef struct { + uint32_t cmd; + uint32_t issue; + uint32_t addr; + uint32_t par[5]; +} CADDY_CMD; + +typedef struct { + uint32_t answer; + uint32_t issue; + uint32_t status; + uint32_t par[5]; +} CADDY_ANSWER; + +typedef struct { + uint8_t magic[16]; + uint32_t cmd_in; + uint32_t cmd_out; + uint32_t heartbeat; + uint32_t reserved1; + CADDY_CMD cmd[CMD_SIZE]; + uint32_t answer_in; + uint32_t answer_out; + uint32_t reserved2; + uint32_t reserved3; + CADDY_ANSWER answer[CMD_SIZE]; +} CADDY_INTERFACE; please remove all typedefs (see CodingStyle Ch. 5). Use 'struct xxx' in each instance instead. We really would like to keep these typedefs. The reason for this is that multiple customers already are using this header for their work. And
[U-Boot] [PATCH] OneNAND: Runtime badblock support
At bootloader, we don't need to read full page. It takes too long time. Instead it only read pages required for boot. Of course, this patch reduces the boot time Signed-off-by: Kyungmin Park kyungmin.p...@samsung.com --- diff --git a/drivers/mtd/onenand/onenand_bbt.c b/drivers/mtd/onenand/onenand_bbt.c index c4bdb57..8bc9e8a 100644 --- a/drivers/mtd/onenand/onenand_bbt.c +++ b/drivers/mtd/onenand/onenand_bbt.c @@ -48,6 +48,43 @@ static int check_short_pattern(uint8_t * buf, int len, int paglen, return 0; } +static int read_page_oob(struct mtd_info *mtd, loff_t from, u_char *buf) +{ + struct onenand_chip *this = mtd-priv; + struct bbm_info *bbm = this-bbm; + struct nand_bbt_descr *bd = bbm-badblock_pattern; + struct mtd_oob_ops ops; + int ret, scanlen, block, j, res; + + scanlen = 0; + + ops.mode = MTD_OOB_PLACE; + ops.ooblen = 16; + ops.oobbuf = buf; + ops.len = ops.ooboffs = ops.retlen = ops.oobretlen = 0; + + /* Get block number * 2 */ + block = (int)(from (bbm-bbt_erase_shift - 1)); + + /* Set as normal block */ + res = 0x00; + bbm-bbt[block 3] |= 0x00 (block 0x6); + + for (j = 0; j 2; j++) { + ret = onenand_bbt_read_oob(mtd, from + j * mtd-writesize + bd-offs, ops); + if (ret || check_short_pattern(buf[j * scanlen], scanlen, mtd-writesize, bd)) { + bbm-bbt[block 3] |= 0x03 (block 0x6); + res = 0x03; + printk(KERN_WARNING Bad eraseblock %d at 0x%08x\n, + block 1, (unsigned int) from); + mtd-ecc_stats.badblocks++; + break; + } + } + + return ret; +} + /** * create_bbt - [GENERIC] Create a bad block table by scanning the device * @param mtd MTD device structure @@ -155,6 +192,11 @@ static int onenand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) block = (int)(offs (bbm-bbt_erase_shift - 1)); res = (bbm-bbt[block 3] (block 0x06)) 0x03; + if (this-options ONENAND_RUNTIME_BADBLOCK_CHECK) { + if (res == 0x02) + res = read_page_oob(mtd, offs, this-oob_buf); + } + MTDDEBUG (MTD_DEBUG_LEVEL2, onenand_isbad_bbt: bbt info for offs 0x%08x: (block %d) 0x%02x\n, (unsigned int)offs, block 1, res); @@ -210,6 +252,12 @@ int onenand_scan_bbt(struct mtd_info *mtd, struct nand_bbt_descr *bd) if (!bbm-isbad_bbt) bbm-isbad_bbt = onenand_isbad_bbt; + if (this-options ONENAND_RUNTIME_BADBLOCK_CHECK) { + printk(KERN_INFO Scanning device for bad blocks (skipped)\n); + memset(bbm-bbt, 0xaa, len); + return 0; + } + /* Scan the device to build a memory based bad block table */ if ((ret = onenand_memory_bbt(mtd, bd))) { printk(KERN_ERR diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 4b0c923..76dfce4 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h @@ -135,6 +135,7 @@ struct onenand_chip { #define ONENAND_HAS_CONT_LOCK (0x0001) #define ONENAND_HAS_UNLOCK_ALL (0x0002) #define ONENAND_HAS_2PLANE (0x0004) +#define ONENAND_RUNTIME_BADBLOCK_CHECK (0x0200) #define ONENAND_PAGEBUF_ALLOC (0x1000) #define ONENAND_OOBBUF_ALLOC (0x2000) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH V2] ppc4xx: use SPRN_TCR macro instead of tcr
Dear Matthias Fuchs, In message 200907211154.16125.matthias.fu...@esd.eu you wrote: This patch migrates 4xx code from using the lowercase tcr macro to the SPRN_TCR macro. Both macros have been defined in the past. So one is to much and uppercase macros are much more common. The lowercase macro conflicts with the upcoming introduction of the ppc4xx_gpio struct and it's tcr field. Doing more such migration and getting rid of many defines from include/ppc405.h and include/ppc440.h should be put on our TODO list. patch v2: better use SPRN_TCR instead of TCR Hm... why are you just fixing this single register? It's not the only one... diff --git a/include/ppc405.h b/include/ppc405.h index 917afec..50fc7be 100644 --- a/include/ppc405.h +++ b/include/ppc405.h @@ -61,7 +61,6 @@ #define dear 0x3d5 /* data exeption address register */ #define evpr 0x3d6 /* exeption vector prefix register */ #define tsr 0x3d8 /* timer status register */ - #define tcr 0x3da /* timer control register */ #define pit 0x3db /* programmable interval timer */ #define sgr 0x3b9 /* storage guarded reg */ #define dcwr 0x3ba /* data cache write-thru reg*/ diff --git a/include/ppc440.h b/include/ppc440.h index 01f6eaf..df78eea 100644 --- a/include/ppc440.h +++ b/include/ppc440.h @@ -90,7 +90,6 @@ #define dvc1 0x13e /* data value compare 1 */ #define dvc2 0x13f /* data value compare 2 */ #define tsr0x150 /* timer status register */ -#define tcr0x154 /* timer control register */ #define ivor0 0x190 /* interrupt vector offset register 0 */ #define ivor1 0x191 /* interrupt vector offset register 1 */ #define ivor2 0x192 /* interrupt vector offset register 2 */ _ALL_ these #defines for Special Purpose Registers should go away. They are redundant. 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 At least they're __EXPERIENCED incompetents ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] Add AVR32 LCD support
This patch adds support for the AVR32 LCD controller. This patch is based off the latest u-boot-video. A quick summary of what's going on:- Enable LCDC pixel clock Enable LCDC port pins Add framebuffer pointer to global_data struct Allocate framebuffer To use the new code, update your board config to include something like this:- #define CONFIG_LCD 1 #if defined(CONFIG_LCD) #define CONFIG_CMD_BMP #define CONFIG_ATMEL_LCD1 #define LCD_BPP LCD_COLOR16 #define CONFIG_BMP_16BPP1 #define CONFIG_FB_ADDR 0x1060 #define CONFIG_WHITE_ON_BLACK 1 #define CONFIG_VIDEO_BMP_GZIP 1 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE 262144 #define CONFIG_ATMEL_LCD_BGR555 1 #define CONFIG_SYS_CONSOLE_IS_IN_ENV1 #define CONFIG_SPLASH_SCREEN1 #endif The standard U-Boot BMP and Splash-screen features should just work. Signed-off-by: Mark Jackson m...@mimc.co.uk --- cpu/at32ap/at32ap700x/clk.c |5 + cpu/at32ap/at32ap700x/portmux.c | 90 + include/asm-avr32/arch-at32ap700x/chip-features.h |5 + include/asm-avr32/arch-at32ap700x/clk.h |6 ++ include/asm-avr32/arch-at32ap700x/portmux.h |5 +- include/asm-avr32/global_data.h |3 + lib_avr32/board.c | 11 +++ 7 files changed, 124 insertions(+), 1 deletions(-) diff --git a/cpu/at32ap/at32ap700x/clk.c b/cpu/at32ap/at32ap700x/clk.c index 2c2e19c..742bc6b 100644 --- a/cpu/at32ap/at32ap700x/clk.c +++ b/cpu/at32ap/at32ap700x/clk.c @@ -65,6 +65,11 @@ void clk_init(void) #ifdef CONFIG_PLL /* Use PLL0 as main clock */ sm_writel(PM_MCCTRL, SM_BIT(PLLSEL)); + +#ifdef CONFIG_LCD + /* Set up pixel clock for the LCDC */ + sm_writel(PM_GCCTRL(7), SM_BIT(PLLSEL) | SM_BIT(CEN)); +#endif #endif } diff --git a/cpu/at32ap/at32ap700x/portmux.c b/cpu/at32ap/at32ap700x/portmux.c index 2a3b004..e71b2bf 100644 --- a/cpu/at32ap/at32ap700x/portmux.c +++ b/cpu/at32ap/at32ap700x/portmux.c @@ -202,3 +202,93 @@ void portmux_enable_spi1(unsigned long cs_mask, unsigned long drive_strength) PORTMUX_DIR_OUTPUT | PORTMUX_INIT_HIGH); } #endif + +#ifdef AT32AP700x_CHIP_HAS_LCDC +void portmux_enable_lcdc(int pin_config) +{ + unsigned long portc_mask = 0; + unsigned long portd_mask = 0; + unsigned long porte_mask = 0; + + switch(pin_config) { + case 0: + portc_mask = (1 19) /* CC */ + | (1 20) /* HSYNC */ + | (1 21) /* PCLK */ + | (1 22) /* VSYNC */ + | (1 23) /* DVAL */ + | (1 24) /* MODE */ + | (1 25) /* PWR*/ + | (1 26) /* DATA0 */ + | (1 27) /* DATA1 */ + | (1 28) /* DATA2 */ + | (1 29) /* DATA3 */ + | (1 30) /* DATA4 */ + | (1 31);/* DATA5 */ + + portd_mask = (1 0) /* DATA6 */ + | (1 1) /* DATA7 */ + | (1 2) /* DATA8 */ + | (1 3) /* DATA9 */ + | (1 4) /* DATA10 */ + | (1 5) /* DATA11 */ + | (1 6) /* DATA12 */ + | (1 7) /* DATA13 */ + | (1 8) /* DATA14 */ + | (1 9) /* DATA15 */ + | (1 10) /* DATA16 */ + | (1 11) /* DATA17 */ + | (1 12) /* DATA18 */ + | (1 13) /* DATA19 */ + | (1 14) /* DATA20 */ + | (1 15) /* DATA21 */ + | (1 16) /* DATA22 */ + | (1 17);/* DATA23 */ + break; + + case 1: + portc_mask = (1 20) /* HSYNC */ + | (1 21) /* PCLK */ + | (1 22) /* VSYNC */ + | (1 25) /* PWR*/ + | (1 31);/* DATA5 */ + + portd_mask = (1 0) /* DATA6 */ + | (1 1) /* DATA7 */ + | (1 7) /* DATA13 */ + | (1 8) /* DATA14 */ + | (1 9) /* DATA15 */ + | (1 16) /* DATA22 */ + | (1 17);/* DATA23 */ + + porte_mask = (1 0) /* CC */ + | (1 1) /* DVAL */ + | (1 2) /* MODE */ + | (1 3) /*
[U-Boot] [PATCH] Add 16bit colour support in lcd.h
This patch adds support for LCD_COLOR16 in include/lcd.h. Signed-off-by: Mark Jackson m...@mimc.co.uk --- include/lcd.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/include/lcd.h b/include/lcd.h index f054cac..0d6549c 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -314,7 +314,7 @@ void lcd_show_board_info(void); #if LCD_BPP == LCD_MONOCHROME # define COLOR_MASK(c) ((c) | (c) 1 | (c) 2 | (c) 3 | \ (c) 4 | (c) 5 | (c) 6 | (c) 7) -#elif LCD_BPP == LCD_COLOR8 +#elif (LCD_BPP == LCD_COLOR8) || (LCD_BPP == LCD_COLOR16) # define COLOR_MASK(c) (c) #else # error Unsupported LCD BPP. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V5] ppc4xx: Add 405EP based PMC405DE board
patch v2: - coding style cleanup - added CONFIG_PHY1_ADDR patch v3: - refactor PLL reconfiguration code - beautify some one-line-functions patch v4: - remove 'sbe' command - add CONFIG_CMD_CHIP_CONFIG support - use ppc4xx_gpio struct for GPIO access - use set/clrbits_be32 to modify GPIO registers - add CPLD register struct patch v5: - add patch history to commit message Signed-off-by: Matthias Fuchs matthias.fu...@esd.eu --- MAINTAINERS |1 + MAKEALL |1 + Makefile |3 + board/esd/pmc405de/Makefile | 53 board/esd/pmc405de/chip_config.c | 47 board/esd/pmc405de/config.mk | 23 ++ board/esd/pmc405de/pmc405de.c| 521 ++ board/esd/pmc405de/u-boot.lds| 133 ++ include/configs/PMC405DE.h | 378 +++ 9 files changed, 1160 insertions(+), 0 deletions(-) create mode 100644 board/esd/pmc405de/Makefile create mode 100644 board/esd/pmc405de/chip_config.c create mode 100644 board/esd/pmc405de/config.mk create mode 100644 board/esd/pmc405de/pmc405de.c create mode 100644 board/esd/pmc405de/u-boot.lds create mode 100644 include/configs/PMC405DE.h diff --git a/MAINTAINERS b/MAINTAINERS index 575a7ec..484040c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -171,6 +171,7 @@ Matthias Fuchs matthias.fu...@esd-electronics.com PCI405 PPC405GP PLU405 PPC405EP PMC405 PPC405GP + PMC405DEPPC405EP PMC440 PPC440EPx VOH405 PPC405EP VOM405 PPC405EP diff --git a/MAKEALL b/MAKEALL index 020ff73..f36a5fd 100755 --- a/MAKEALL +++ b/MAKEALL @@ -237,6 +237,7 @@ LIST_4xx= \ PIP405 \ PLU405 \ PMC405 \ + PMC405DE\ PMC440 \ PPChameleonEVB \ quad100hd \ diff --git a/Makefile b/Makefile index 090e645..a5d397b 100644 --- a/Makefile +++ b/Makefile @@ -1492,6 +1492,9 @@ PLU405_config:unconfig PMC405_config: unconfig @$(MKCONFIG) $(@:_config=) ppc ppc4xx pmc405 esd +PMC405DE_config: unconfig + @$(MKCONFIG) $(@:_config=) ppc ppc4xx pmc405de esd + PMC440_config: unconfig @$(MKCONFIG) $(@:_config=) ppc ppc4xx pmc440 esd diff --git a/board/esd/pmc405de/Makefile b/board/esd/pmc405de/Makefile new file mode 100644 index 000..a080649 --- /dev/null +++ b/board/esd/pmc405de/Makefile @@ -0,0 +1,53 @@ +# +# (C) Copyright 2000-2006 +# 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-y= $(BOARD).o +COBJS-y+= ../common/cmd_loadpci.o +COBJS-$(CONFIG_CMD_CHIP_CONFIG) += chip_config.o + +COBJS := $(COBJS-y) +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(OBJS) $(SOBJS) + $(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/esd/pmc405de/chip_config.c b/board/esd/pmc405de/chip_config.c new file mode 100644 index 000..f1cafc1 --- /dev/null +++ b/board/esd/pmc405de/chip_config.c @@ -0,0 +1,47 @@ +/* + * (C) Copyright 2008-2009 + * Stefan Roese, DENX Software Engineering, s...@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
Re: [U-Boot] [PATCH V2] ppc4xx: use SPRN_TCR macro instead of tcr
On Tuesday 21 July 2009 12:06, Wolfgang Denk wrote: Dear Matthias Fuchs, In message 200907211154.16125.matthias.fu...@esd.eu you wrote: This patch migrates 4xx code from using the lowercase tcr macro to the SPRN_TCR macro. Both macros have been defined in the past. So one is to much and uppercase macros are much more common. The lowercase macro conflicts with the upcoming introduction of the ppc4xx_gpio struct and it's tcr field. Doing more such migration and getting rid of many defines from include/ppc405.h and include/ppc440.h should be put on our TODO list. patch v2: better use SPRN_TCR instead of TCR Hm... why are you just fixing this single register? It's not the only one... You are right. As you might think of, I want to get my PMC405DE board support patch accepted in this closing merge window. I also noticed that there are other macros that are obsolete and tha't why I netioned this in my commit message. So I am aware of this. But that's another story. I will see if I find some time later today. Matthias diff --git a/include/ppc405.h b/include/ppc405.h index 917afec..50fc7be 100644 --- a/include/ppc405.h +++ b/include/ppc405.h @@ -61,7 +61,6 @@ #define dear 0x3d5 /* data exeption address register */ #define evpr 0x3d6 /* exeption vector prefix register */ #define tsr 0x3d8 /* timer status register */ - #define tcr 0x3da /* timer control register */ #define pit 0x3db /* programmable interval timer */ #define sgr 0x3b9 /* storage guarded reg */ #define dcwr 0x3ba /* data cache write-thru reg*/ diff --git a/include/ppc440.h b/include/ppc440.h index 01f6eaf..df78eea 100644 --- a/include/ppc440.h +++ b/include/ppc440.h @@ -90,7 +90,6 @@ #define dvc1 0x13e /* data value compare 1 */ #define dvc2 0x13f /* data value compare 2 */ #define tsr0x150 /* timer status register */ -#define tcr0x154 /* timer control register */ #define ivor0 0x190 /* interrupt vector offset register 0 */ #define ivor1 0x191 /* interrupt vector offset register 1 */ #define ivor2 0x192 /* interrupt vector offset register 2 */ _ALL_ these #defines for Special Purpose Registers should go away. They are redundant. Best regards, Wolfgang Denk ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Remove static declaration from gunzip_bmp()
This patch removes the static declaration from gunzip_bmp() Without it, the gunzip_bmp() function is not visible to common/lcd.c and fails to compile with an error. Signed-off-by: Mark Jackson m...@mimc.co.uk --- common/cmd_bmp.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/cmd_bmp.c b/common/cmd_bmp.c index fc8462e..27d5896 100644 --- a/common/cmd_bmp.c +++ b/common/cmd_bmp.c @@ -46,7 +46,7 @@ int gunzip(void *, int, unsigned char *, unsigned long *); * didn't contain a valid BMP signature. */ #ifdef CONFIG_VIDEO_BMP_GZIP -static bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp) +bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp) { void *dst; unsigned long len; @@ -85,7 +85,7 @@ static bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp) return bmp; } #else -static bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp) +bmp_image_t *gunzip_bmp(unsigned long addr, unsigned long *lenp) { return NULL; } ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Add LCD support to MIMC200 board
This patch updates the MIMC200 files to enable the LCD. Signed-off-by: Mark Jackson m...@mimc.co.uk --- board/mimc/mimc200/mimc200.c | 34 ++ include/configs/mimc200.h| 16 2 files changed, 50 insertions(+), 0 deletions(-) diff --git a/board/mimc/mimc200/mimc200.c b/board/mimc/mimc200/mimc200.c index 6df741e..78441c3 100644 --- a/board/mimc/mimc200/mimc200.c +++ b/board/mimc/mimc200/mimc200.c @@ -28,10 +28,40 @@ #include asm/arch/gpio.h #include asm/arch/hmatrix.h #include asm/arch/portmux.h +#include atmel_lcdc.h #include lcd.h #include ../../../cpu/at32ap/hsmc3.h +#if defined(CONFIG_LCD) +/* 480x272x16 @ 72 Hz */ +vidinfo_t panel_info = { + .vl_col = 480, /* Number of columns */ + .vl_row = 272, /* Number of rows */ + .vl_clk = 1000, /* pixel clock in ps */ + .vl_sync= ATMEL_LCDC_INVCLK_INVERTED | + ATMEL_LCDC_INVLINE_INVERTED | + ATMEL_LCDC_INVFRAME_INVERTED, + .vl_bpix= LCD_COLOR16, /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8, 4 = 16 */ + .vl_tft = 1,/* 0 = passive, 1 = TFT */ + .vl_hsync_len = 42, /* Length of horizontal sync */ + .vl_left_margin = 1,/* Time from sync to picture */ + .vl_right_margin= 1,/* Time from picture to sync */ + .vl_vsync_len = 1,/* Length of vertical sync */ + .vl_upper_margin= 12, /* Time from sync to picture */ + .vl_lower_margin= 1,/* Time from picture to sync */ + .mmio = LCDC_BASE,/* Memory mapped registers */ +}; + +void lcd_enable(void) +{ +} + +void lcd_disable(void) +{ +} +#endif + DECLARE_GLOBAL_DATA_PTR; static const struct sdram_config sdram_config = { @@ -110,6 +140,10 @@ int board_early_init_f(void) portmux_enable_mmci(0, PORTMUX_MMCI_4BIT, PORTMUX_DRIVE_LOW); #endif +#if defined(CONFIG_LCD) + portmux_enable_lcdc(1); +#endif + return 0; } diff --git a/include/configs/mimc200.h b/include/configs/mimc200.h index 8ff2f8a..8f71664 100644 --- a/include/configs/mimc200.h +++ b/include/configs/mimc200.h @@ -82,6 +82,8 @@ #define CONFIG_DISABLE_CONSOLE 1 /* disable console */ #define CONFIG_SYS_DEVICE_NULLDEV 1 /* include nulldev device */ +#define CONFIG_LCD 1 + /* * Only interrupt autoboot if space is pressed. Otherwise, garbage * data on the serial line may interrupt the boot sequence. @@ -127,6 +129,20 @@ #define CONFIG_MMC 1 #define CONFIG_ATMEL_MCI 1 +#if defined(CONFIG_LCD) +#define CONFIG_CMD_BMP +#define CONFIG_ATMEL_LCD 1 +#define LCD_BPPLCD_COLOR16 +#define CONFIG_BMP_16BPP 1 +#define CONFIG_FB_ADDR 0x1060 +#define CONFIG_WHITE_ON_BLACK 1 +#define CONFIG_VIDEO_BMP_GZIP 1 +#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE 262144 +#define CONFIG_ATMEL_LCD_BGR5551 +#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 +#define CONFIG_SPLASH_SCREEN 1 +#endif + #define CONFIG_SYS_DCACHE_LINESZ 32 #define CONFIG_SYS_ICACHE_LINESZ 32 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/2] P2020RDB Support Added
Hello All The following patch series add P2020RDB platform support in u-boot. 1. [PATCH 1/2] Removed CONFIG_NUM_CPUS for 85xx/86xx Freescale processor series. This patch removes the compiler define for CONFIG_NUM_CPUS, instead the value is obtained dynamically by reading the SVR value and checking for it in the CPU_TYPE_ENTRY . The advantage of this is that we may be able to use the same u-boot image across the platforms where there are minor differences amongst them for example P1/P2 series of QorIQ processors. 2. [PATCH 2/2] P2020RDB Platform support added. Basic platform support has been tested along with eTSEC, NAND, NOR, I2C, PCIe etc. Overview of P2020RDB platform == - DDR DDR2 1G - NOR Flash 16MByte - NAND Flash 32MByte - Ethernet There are 3 ethernet interfaces 1) etSEC1 - RGMII - connected to a 5 port Vitesse Switch(VSC7385) - Switch is memory mapped through eLBC interface(CS#2) - IRQ1 2) etSEC2 - SGMII - connected to VSC8221 - IRQ2 3) etSEC3 - RGMII - connected to VSC8641 - IRQ3 - 2 1X PCIe interfaces - SD/MMC ,USB - SPI EEPROM - Serial I2C EEPROM u-boot version 2009.06 prepared from http://git.denx.de/u-boot-mpc85xx.git Last 2 commits on the tree commit 8e5e9b940cdede0debe528cdd7edbb3ebf2a Author: Wolfgang Denk w...@denx.de Date: Tue Jul 7 22:35:02 2009 +0200 Coding style cleanup; update CHANGELOG Signed-off-by: Wolfgang Denk w...@denx.de commit a48ecc969f8d2d0fe9167962e9b8b4cca52de10b Merge: bec9cab... ceb70b4... Author: Wolfgang Denk w...@denx.de Date: Tue Jul 7 22:22:05 2009 +0200 Merge branch 'master' of git://git.denx.de/u-boot-arm Conflicts: drivers/spi/Makefile Signed-off-by: Wolfgang Denk w...@denx.de Regards Poonam ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/2] Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
The number of CPUs are getting detected dynamically by checking the processor SVR value. Also removed CONFIG_NUM_CPUS references from all the platforms with 85xx/86xx processors. This can help to use the same u-boot image across the platforms. Also revamped and corrected few Freescale Copyright messages. Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com --- common/cmd_mp.c |6 +- cpu/mpc85xx/cpu.c | 111 ++--- cpu/mpc85xx/mp.c |6 +- cpu/mpc85xx/release.S | 25 +- cpu/mpc85xx/speed.c |4 +- cpu/mpc86xx/cpu.c | 44 ++-- cpu/mpc86xx/cpu_init.c|2 +- include/asm-ppc/config.h | 41 +++ include/asm-ppc/global_data.h |4 ++ include/asm-ppc/processor.h |5 +- include/common.h |2 + include/configs/MPC8572DS.h |1 - include/configs/MPC8610HPCD.h |1 - include/configs/MPC8641HPCN.h |1 - include/configs/P2020DS.h |1 - include/configs/XPEDITE5170.h |1 - include/configs/XPEDITE5370.h |1 - include/configs/sbc8641d.h|1 - include/e500.h|6 +-- lib_ppc/board.c |4 ++ lib_ppc/bootm.c |2 +- 21 files changed, 197 insertions(+), 72 deletions(-) diff --git a/common/cmd_mp.c b/common/cmd_mp.c index faa8700..4f2c639 100644 --- a/common/cmd_mp.c +++ b/common/cmd_mp.c @@ -1,5 +1,5 @@ /* - * Copyright 2008 Freescale Semiconductor, Inc. + * Copyright (C) 2008-2009 Freescale Semiconductor, Inc. All rights reserved. * * See file CREDITS for list of people who contributed to this * project. @@ -34,9 +34,9 @@ cpu_cmd(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) } cpuid = simple_strtoul(argv[1], NULL, 10); - if (cpuid = CONFIG_NUM_CPUS) { + if (cpuid = cpu_numcores()) { printf (Core num: %lu is out of range[0..%d]\n, - cpuid, CONFIG_NUM_CPUS - 1); + cpuid, cpu_numcores() - 1); return 1; } diff --git a/cpu/mpc85xx/cpu.c b/cpu/mpc85xx/cpu.c index 28c6119..ff7bff1 100644 --- a/cpu/mpc85xx/cpu.c +++ b/cpu/mpc85xx/cpu.c @@ -1,5 +1,5 @@ /* - * Copyright 2004,2007,2008 Freescale Semiconductor, Inc. + * Copyright(C) 2004,2007-2009 Freescale Semiconductor, Inc. All rights reserved. * (C) Copyright 2002, 2003 Motorola Inc. * Xianghua Xiao (x.x...@motorola.com) * @@ -38,37 +38,37 @@ DECLARE_GLOBAL_DATA_PTR; struct cpu_type cpu_type_list [] = { - CPU_TYPE_ENTRY(8533, 8533), - CPU_TYPE_ENTRY(8533, 8533_E), - CPU_TYPE_ENTRY(8535, 8535), - CPU_TYPE_ENTRY(8535, 8535_E), - CPU_TYPE_ENTRY(8536, 8536), - CPU_TYPE_ENTRY(8536, 8536_E), - CPU_TYPE_ENTRY(8540, 8540), - CPU_TYPE_ENTRY(8541, 8541), - CPU_TYPE_ENTRY(8541, 8541_E), - CPU_TYPE_ENTRY(8543, 8543), - CPU_TYPE_ENTRY(8543, 8543_E), - CPU_TYPE_ENTRY(8544, 8544), - CPU_TYPE_ENTRY(8544, 8544_E), - CPU_TYPE_ENTRY(8545, 8545), - CPU_TYPE_ENTRY(8545, 8545_E), - CPU_TYPE_ENTRY(8547, 8547_E), - CPU_TYPE_ENTRY(8548, 8548), - CPU_TYPE_ENTRY(8548, 8548_E), - CPU_TYPE_ENTRY(8555, 8555), - CPU_TYPE_ENTRY(8555, 8555_E), - CPU_TYPE_ENTRY(8560, 8560), - CPU_TYPE_ENTRY(8567, 8567), - CPU_TYPE_ENTRY(8567, 8567_E), - CPU_TYPE_ENTRY(8568, 8568), - CPU_TYPE_ENTRY(8568, 8568_E), - CPU_TYPE_ENTRY(8569, 8569), - CPU_TYPE_ENTRY(8569, 8569_E), - CPU_TYPE_ENTRY(8572, 8572), - CPU_TYPE_ENTRY(8572, 8572_E), - CPU_TYPE_ENTRY(P2020, P2020), - CPU_TYPE_ENTRY(P2020, P2020_E), + CPU_TYPE_ENTRY(8533, 8533, 1), + CPU_TYPE_ENTRY(8533, 8533_E, 1), + CPU_TYPE_ENTRY(8535, 8535, 1), + CPU_TYPE_ENTRY(8535, 8535_E, 1), + CPU_TYPE_ENTRY(8536, 8536, 1), + CPU_TYPE_ENTRY(8536, 8536_E, 1), + CPU_TYPE_ENTRY(8540, 8540, 1), + CPU_TYPE_ENTRY(8541, 8541, 1), + CPU_TYPE_ENTRY(8541, 8541_E, 1), + CPU_TYPE_ENTRY(8543, 8543, 1), + CPU_TYPE_ENTRY(8543, 8543_E, 1), + CPU_TYPE_ENTRY(8544, 8544, 1), + CPU_TYPE_ENTRY(8544, 8544_E, 1), + CPU_TYPE_ENTRY(8545, 8545, 1), + CPU_TYPE_ENTRY(8545, 8545_E, 1), + CPU_TYPE_ENTRY(8547, 8547_E, 1), + CPU_TYPE_ENTRY(8548, 8548, 1), + CPU_TYPE_ENTRY(8548, 8548_E, 1), + CPU_TYPE_ENTRY(8555, 8555, 1), + CPU_TYPE_ENTRY(8555, 8555_E, 1), + CPU_TYPE_ENTRY(8560, 8560, 1), + CPU_TYPE_ENTRY(8567, 8567, 1), + CPU_TYPE_ENTRY(8567, 8567_E, 1), + CPU_TYPE_ENTRY(8568, 8568, 1), + CPU_TYPE_ENTRY(8568, 8568_E, 1), + CPU_TYPE_ENTRY(8569, 8569, 1), + CPU_TYPE_ENTRY(8569, 8569_E, 1), + CPU_TYPE_ENTRY(8572, 8572, 2), + CPU_TYPE_ENTRY(8572, 8572_E, 2), + CPU_TYPE_ENTRY(P2020, P2020, 2), + CPU_TYPE_ENTRY(P2020,
Re: [U-Boot] [PATCH] OneNAND: Runtime badblock support
Dear Kyungmin Park, In message 20090721095528.ga23...@july you wrote: At bootloader, we don't need to read full page. It takes too long time. Instead it only read pages required for boot. Of course, this patch reduces the boot time What does don't need to read full page mean? when we read pages, we always read fullpages, don't we? @@ -155,6 +192,11 @@ static int onenand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) block = (int)(offs (bbm-bbt_erase_shift - 1)); res = (bbm-bbt[block 3] (block 0x06)) 0x03; + if (this-options ONENAND_RUNTIME_BADBLOCK_CHECK) { + if (res == 0x02) + res = read_page_oob(mtd, offs, this-oob_buf); + } + ONENAND_RUNTIME_BADBLOCK_CHECK is a new #define, right? It should be documented (for example in the README, or even better in doc/README.OneNand or so). 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 Quote from the Boss after overriding the decision of a task force he created to find a solution: I'm sorry if I ever gave you the impression your input would have any effect on my decision for the outcome of this project! ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 0/2] P2020RDB Support Added
Dear Aggrwal Poonam-B10812, In message 1bd5cfc378ed0946b688e0c9ba2ef095129...@zin33exm24.fsl.freescale.net you wrote: The following patch series add P2020RDB platform support in u-boot. You are probably aware thatthe merge window is closed. That means that this will have to wait for the next merge window to open (according to schedule in early September). The responsible custodian may decide to run this thorugh his (and then my) next branch, though. Which brings up the next question: Kumar: who is supposed to be responsible custodian for QorIQ code? Should we update / reorganize the list of custodians for Freescale's processors? 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 A committee is a life form with six or more legs and no brain. -- Lazarus Long, Time Enough For Love ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] OneNAND: Runtime badblock support
Hi, On Tue, Jul 21, 2009 at 7:50 PM, Wolfgang Denkw...@denx.de wrote: Dear Kyungmin Park, In message 20090721095528.ga23...@july you wrote: At bootloader, we don't need to read full page. It takes too long time. Instead it only read pages required for boot. Of course, this patch reduces the boot time What does don't need to read full page mean? It means all blocks at scanning time. when we read pages, we always read fullpages, don't we? @@ -155,6 +192,11 @@ static int onenand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt) block = (int)(offs (bbm-bbt_erase_shift - 1)); res = (bbm-bbt[block 3] (block 0x06)) 0x03; + if (this-options ONENAND_RUNTIME_BADBLOCK_CHECK) { + if (res == 0x02) + res = read_page_oob(mtd, offs, this-oob_buf); + } + ONENAND_RUNTIME_BADBLOCK_CHECK is a new #define, right? It should be documented (for example in the README, or even better in doc/README.OneNand or so). It's OneNAND specific option. Umm I'll try to describe it Thank you, Kyungmin Park ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/2 V2] new video driver and board update
Hello, the following patch set (second version) introduced a new common video driver (patch part 1) and update current boards (EB+MCF-EV123) to use it (patch part 2). this driver is also used for upcomming new boards with vcxk hardware. The code of this second version has been completely revised. No board-specific VCxK code is located in the config files. Some alignment, indent and code style issues are fixed. regards Jens Scharsig ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/2 V2] update the EB+MCF-EV123 board support
This patch updates the support for EB+MCF-EV123 board and needs the [PATCH 1/2 V2] new video driver for bus vcxk framebuffers * remove the board framebuffer driver * use the common bus_vcxk framebuffer driver * adds bmp support * adds splashimage support * fix serveral cosmetical errors Signed-off-by: Jens Scharsig e...@bus-elektronik.de --- diff --git a/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c b/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c index 73dfb3d..ef09246 100644 --- a/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c +++ b/board/BuS/EB+MCF-EV123/EB+MCF-EV123.c @@ -27,7 +27,18 @@ #include common.h #include command.h #include asm/m5282.h -#include VCxK.h +#include bmp_layout.h +#include status_led.h +#include bus_vcxk.h + +/*---*/ + +DECLARE_GLOBAL_DATA_PTR; + +unsigned long display_width; +unsigned long display_height; + +/*---*/ int checkboard (void) { @@ -89,7 +100,6 @@ phys_size_t initdram (int board_type) return size; } - #if defined(CONFIG_SYS_DRAM_TEST) int testdram (void) { @@ -126,37 +136,112 @@ int testdram (void) int misc_init_r(void) { - init_vcxk(); +#ifdef CONFIG_HW_WATCHDOG + hw_watchdog_init(); +#endif +#ifndef CONFIG_VIDEO + vcxk_init(16,16); +#endif return 1; } +#if defined(CONFIG_VIDEO) + +/* + h* EB+CPU5282-T1/drv_video_init + * FUNCTION + *** +*/ + +intdrv_video_init (void) +{ + char *s; + unsigned long splash; + + printf(Init Video as ); + + if ((s = getenv (displaywidth)) != NULL) + { + display_width = simple_strtoul (s, NULL, 10); + } + else + { + display_width=256; + } + if ((s = getenv (displayheight)) != NULL) + { + display_height = simple_strtoul (s, NULL, 10); + } + else + { + display_height=256; + } + printf(%lu x %lu pixel matrix\n,display_width,display_height); + + MCFCCM_CCR = ~MCFCCM_CCR_SZEN; + MCFGPIO_PEPAR = ~MCFGPIO_PEPAR_PEPA2; + + vcxk_init(display_width,display_height); + +#ifdef CONFIG_SPLASH_SCREEN + if ((s = getenv (splashimage)) != NULL) + { + debug(use splashimage: %s\n,s); + splash = simple_strtoul (s, NULL, 16); + debug(use splashimage: %x\n,splash); + vcxk_acknowledge_wait(); + video_display_bitmap (splash, 0, 0); + } +#endif + return 0; +} + +#endif + /*---*/ -int do_vcimage (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) +#ifdef CONFIG_VIDEO +int do_brightness (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) { int rcode = 0; - ulong source; + ulong side; + ulong bright; switch (argc) { - case 2: - source = simple_strtoul(argv[1],NULL,16); - vcxk_loadimage(source); - rcode = 0; + case 3: + side = simple_strtoul(argv[1],NULL,10); + bright = simple_strtoul(argv[2],NULL,10); + if ((side=0) (side=3) + (bright=0) (bright=1000)) + { + vcxk_setbrightness(side,bright); + rcode = 0; + } + else + { + printf (parameters out of range\n); + printf (Usage:\n%s\n, cmdtp-usage); + rcode = 1; + } break; default: - cmd_usage(cmdtp); + printf (Usage:\n%s\n, cmdtp-usage); rcode = 1; break; } return rcode; } -/***/ +/*---*/ U_BOOT_CMD( - vcimage,2, 0, do_vcimage, - loads an image to Display, - vcimage addr + bright, 3, 0, do_brightness, + sets the display brightness\n, +side 0..1000\nside: 0/3=both; 1=first; 2=second\n ); -/* EOF EB+MCF-EV123c */ +#endif + +/*---*/ +/* EOF EB+MCF-EV123.c*/ +/*---*/ diff --git a/board/BuS/EB+MCF-EV123/Makefile b/board/BuS/EB+MCF-EV123/Makefile index ed3ac07..44961b9 100644 --- a/board/BuS/EB+MCF-EV123/Makefile +++ b/board/BuS/EB+MCF-EV123/Makefile @@ -25,7 +25,7 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).a -COBJS
[U-Boot] [PATCH 1/2 V2] new video driver for bus vcxk framebuffers
This patch adds a new video driver * adds common bus_vcxk framebuffer driver Signed-off-by: Jens Scharsig e...@bus-elektronik.de --- diff --git a/doc/README.bus_vcxk b/doc/README.bus_vcxk new file mode 100644 index 000..4eb8fe8 --- /dev/null +++ b/doc/README.bus_vcxk @@ -0,0 +1,85 @@ +/* + * (C) Copyright 2008-2009 + * BuS Elektronik GmbH Co. KG www.bus-elektronik.de + * Jens Scharsig e...@bus-elektronik.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 + */ + +U-Boot vcxk video controller driver +== + +By defining CONFIG_VIDEO_VCXK this driver can be used with VC2K, VC4K and +VC8K devices on following boards: + +board | ARCH | Vendor +--- +EB+CPU5282-T1 | MCF5282 | BuS Elektronik GmbH Co. KG +EB+MCF-EVB123 | MCF5282 | BuS Elektronik GmbH Co. KG +EB+CPUx9K2 | AT91RM9200| BuS Elektronik GmbH Co. KG +ZLSA| AT91RM9200| Ruf Telematik AG + +Driver configuration + + +The driver needs some defines to describe the target hardware: + +CONFIG_SYS_VCXK_BASE + + base address of VCxK hardware memory + +CONFIG_SYS_VCXK_DEFAULT_LINEALIGN + + defines the physical alignment of a pixel row + +CONFIG_SYS_VCXK_DOUBLEBUFFERED + + some boards that use vcxk prevent read from framebuffer memory. + define this option to enable double buffering (needs 16KiB RAM) + +CONFIG_SYS_VCXK__PIN + + defines the number of the I/O line PIN in the port + valid values for are: + + ACKNOWLEDGE + describes the acknowledge line from vcxk hardware + + ENABLE + describes the enable line to vcxk hardware + + INVERT + describes the invert line to vcxk hardware + + RESET + describes the reset line to vcxk hardware + + REQUEST + describes the request line to vcxk hardware + +CONFIG_SYS_VCXK__PORT + + defines the I/O port which is connected with the line + for valid values for see CONFIG_SYS_VCXK__PIN + +CONFIG_SYS_VCXK__DDR + + defines the register which configures the direction + for valid values for see CONFIG_SYS_VCXK__PIN + diff --git a/drivers/video/Makefile b/drivers/video/Makefile index bc00852..bb6b5a0 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -36,6 +36,7 @@ COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o COBJS-$(CONFIG_SED156X) += sed156x.o COBJS-$(CONFIG_VIDEO_SM501) += sm501.o COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o +COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o COBJS-y += videomodes.o COBJS := $(COBJS-y) diff --git a/drivers/video/bus_vcxk.c b/drivers/video/bus_vcxk.c new file mode 100644 index 000..51c15f8 --- /dev/null +++ b/drivers/video/bus_vcxk.c @@ -0,0 +1,436 @@ +/* + * (C) Copyright 2005-2009 + * Jens Scharsig @ BuS Elektronik GmbH Co. KG, e...@bus-elektronik.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 common.h +#include bmp_layout.h +#include asm/io.h + +vu_char *vcxk_bws = ((vu_char *) (CONFIG_SYS_VCXK_BASE)); +vu_short *vcxk_bws_word = ((vu_short *)(CONFIG_SYS_VCXK_BASE)); +vu_long *vcxk_bws_long = ((vu_long *) (CONFIG_SYS_VCXK_BASE)); + +#ifdef CONFIG_AT91RM9200 + #include asm/arch/hardware.h
Re: [U-Boot] [PATCH 1/2] Add ntel PCIE PRO/1000 Network Driver support
-Original Message- From: Ben Warren [mailto:biggerbadder...@gmail.com] Sent: Tuesday, July 21, 2009 14:17 PM To: Zang Roy-R61911 Cc: Kumar Gala; U-Boot-Denx Subject: Re: [U-Boot] [PATCH 1/2] Add ntel PCIE PRO/1000 Network Driver support Hi Roy, Roy Zang wrote: From: Roy Zang tie-fei.z...@freescale.com Based on Intel PRO/1000 Network Driver 7.3.20-k2 Add Intel E1000 PCIE card support. The following cards are added: INTEL_82571EB_COPPER INTEL_82571EB_FIBER, INTEL_82571EB_SERDES INTEL_82571EB_QUAD_COPPER INTEL_82571PT_QUAD_COPPER INTEL_82571EB_QUAD_FIBER INTEL_82571EB_QUAD_COPPER_LOWPROFILE INTEL_82571EB_SERDES_DUAL INTEL_82571EB_SERDES_QUAD INTEL_82572EI_COPPER INTEL_82572EI_FIBER INTEL_82572EI_SERDES INTEL_82572EI INTEL_82573E INTEL_82573E_IAMT INTEL_82573L INTEL_82546GB_QUAD_COPPER_KSP3 INTEL_80003ES2LAN_COPPER_DPT INTEL_80003ES2LAN_SERDES_DPT INTEL_80003ES2LAN_COPPER_SPT INTEL_80003ES2LAN_SERDES_SPT 82571EB_COPPER dual ports, 82572EI single port, 82572EI_COPPER single port PCIE cards and 82545EM_COPPER, 82541GI_LF pci cards are tested on P2020 board, MPC8536DS and MPC8544DS boards. Signed-off-by: Roy Zang tie-fei.z...@freescale.com I have no objections to any of the content. A few themes, though: 1. Please ensure that the multi-line comments are formatted correctly. Lines 2+ should have a space in the first character. Do you find this issue in the patch? 2. If you insist on including dead code (i.e. #if 0), please provide a comment on why it's there Thanks for the understanding. The dead code in the previous file helped me track the code. That is why I left them. I will add the comment and remove the unnecessary one. 3. I have a hard time believing that most of this is necessary. Sure it's a complicated chip and you're pulling it from Intel's driver, but 3000+ lines is too much. Please try to remove stuff that's not needed. I will double check it. Do not believe Intel's code. It take me two days to clean the code style. I will resend it after the code is ready. Thanks. Roy ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Copyright/License text in cpu/ppc4xx/4xx_pci.c
Did you have a look into include ppc440.h? It contains the old IBM copyright and (!!!) a GPL header with copyrights from five IBM people. Hmm, does this bring us any further? Matthias On Thursday 09 July 2009 11:51, Stefan Roese wrote: On Thursday 09 July 2009 11:24:39 Matthias Fuchs wrote: Yes, those files don't have much in common any more. Only some comments (which could be removed or rewritten) and and the sequence of some register initialisation. But again, IANAL and I don't really know if we can remove the IBM header with such a history. It seems nobody is a lawyer! So I think this issue cannot be solved by the U-boot community and therefore the only way seems to be the removal of this file in August as stated in the feature-removal plan. I will not start cleaning up this file as it seems to be a waste of time when the file will be removed in August. Stefan, how do you plan to reach the August goal? I just realised in this thread that this IBM license is incompatible with the GPL. So it's new to me. And even worse, it doesn't only affect the PCI code but also the 4xx EMAC code. So if we have to really remove all the code with this IBM header, 4xx support will be in really bad shape. :-( So it's even more important to know, if such files as this 4xx PCI code, which has nearly nothing in common with the original IBM code, can move to GPL. Not sure how to solve this issue though. Perhaps we should ask somebody at IBM? Best regards, 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: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot -- - Dipl.-Ing. Matthias Fuchs Head of System Design esd electronic system design gmbh Vahrenwalder Str. 207 - 30165 Hannover - GERMANY Phone: +49-511-37298-0 - Fax: +49-511-37298-68 Please visit our homepage http://www.esd.eu Quality Products - Made in Germany - Geschäftsführer: Klaus Detering, Dr. Werner Schulze Amtsgericht Hannover HRB 51373 - VAT-ID DE 115672832 - ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
Dear Poonam Aggrwal, In message 1248173263-30516-1-git-send-email-poonam.aggr...@freescale.com you wrote: The number of CPUs are getting detected dynamically by checking the processor SVR value. Also removed CONFIG_NUM_CPUS references from all the platforms with 85xx/86xx processors. Please restrict your line length to 70 characters or less. ... +#ifndef CONFIG_MP + if (cpu_numcores() 1) + puts(#\n + The system is detected to be MULTICORE,\n + but u-boot is built with UNI-CORE\n + To enable mutlticore Build set CONFIG_MP\n + #\n\n); #endif Please use terse error messages. We don't print prose here. - cpu = identify_cpu(ver); - if (cpu) { + if (cpu_numcores() 1) { + volatile ccsr_pic_t *pic = (void *)(CONFIG_SYS_MPC85xx_PIC_ADDR); + printf(CPU%d: , pic-whoami); + } + else Incorrect brace style. --- a/cpu/mpc85xx/speed.c +++ b/cpu/mpc85xx/speed.c ... @@ -51,7 +51,7 @@ void get_sys_info (sys_info_t * sysInfo) /* Divide before multiply to avoid integer * overflow for processor speeds above 2GHz */ half_freqSystemBus = sysInfo-freqSystemBus/2; - for (i = 0; i CONFIG_NUM_CPUS; i++) { + for (i = 0; i cpu_numcores(); i++) { Only one space before the '', please. ... --- a/cpu/mpc86xx/cpu.c +++ b/cpu/mpc86xx/cpu.c ... +int probecpu (void) +{ + uint svr; + uint ver; + + svr = get_svr(); + ver = SVR_SOC_VER(svr); + + gd-cpu = identify_cpu(ver); + + return 0; +} + +int cpu_numcores() { + struct cpu_type *cpu; + cpu = gd-cpu; + return cpu-num_cores; +} + This seems to be identically repeated code. Please factor out into common code. * Default board reset function */ @@ -66,9 +88,9 @@ checkcpu(void) uint ver; uint major, minor; char buf1[32], buf2[32]; + struct cpu_type *cpu; volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; volatile ccsr_gur_t *gur = immap-im_gur; - struct cpu_type *cpu; uint msscr0 = mfspr(MSSCR0); svr = get_svr(); @@ -76,10 +98,20 @@ checkcpu(void) major = SVR_MAJ(svr); minor = SVR_MIN(svr); +#ifndef CONFIG_MP + if (cpu_numcores() 1) + puts(#\n + The system is detected to be MULTICORE,\n + but u-boot is built with UNI-CORE\n + To enable mutlticore Build set CONFIG_MP\n + #\n\n); +#endif Ditto. puts(CPU: ); - cpu = identify_cpu(ver); - if (cpu) { + cpu = gd-cpu; + + if (cpu-name) { puts(cpu-name); } else { No braces for one-line statements, please. diff --git a/include/asm-ppc/config.h b/include/asm-ppc/config.h index ca143c7..b799a22 100644 --- a/include/asm-ppc/config.h +++ b/include/asm-ppc/config.h @@ -37,4 +37,45 @@ #endif #endif +#if defined(CONFIG_MPC8533) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8535) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8536) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8540) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8541) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8543) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8544) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8545) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8547) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8548) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8555) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8560) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8567) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8568) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8569) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8572) +#define CONFIG_MAX_CPUS 2 +#elif defined(CONFIG_P2020) +#define CONFIG_MAX_CPUS 2 + +#elif defined(CONFIG_MPC8610) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8641) +#define CONFIG_MAX_CPUS 2 +#endif Sorry, but this does not scale. Please find a better solution. diff --git a/include/asm-ppc/global_data.h b/include/asm-ppc/global_data.h index 244c161..aa531b9 100644 --- a/include/asm-ppc/global_data.h +++ b/include/asm-ppc/global_data.h @@ -1,4 +1,5 @@ /* + * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. On which base to you make such a claim? * (C) Copyright 2002 * Wolfgang Denk, DENX Software Engineering, w...@denx.de. * @@ -92,6 +93,9 @@ typedef struct global_data { #if defined(CONFIG_MPC85xx) ||
Re: [U-Boot] Copyright/License text in cpu/ppc4xx/4xx_pci.c
On Tuesday 21 July 2009 13:42:57 Matthias Fuchs wrote: Did you have a look into include ppc440.h? It contains the old IBM copyright and (!!!) a GPL header with copyrights from five IBM people. Hmm, does this bring us any further? Not really. This GPL header was added later with this patch: c46f5b22b1f9098676bea8884fc7db820cf3: Add definitions for 440EPx/GRx SDRAM controller to ppc440.h This patch adds the Denali SDRAM controller definitions to ppc440.h. It also fixes two typos in the definitions, so the board-specific sdram.h files containing these definitions are also fixed to avoid compiler warnings. Signed-off-by: Larry Johnson l...@acm.org So it was not available in the original version. And the addition of is probably in conflict with the IBM header. So the situation didn't change I'm afraid. :-( Best regards, 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: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] lcd.h: define extern vidinfo_t for all cases
From: Alessandro Rubini rub...@gnudd.com include/lcd.h has different vidinfo for different platforms, and several extern declaration, but one for the default case was missing. This makes them a single extern declaration for everyone. Signed-off-by: Alessandro Rubini rub...@gnudd.com --- include/lcd.h |8 ++-- 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/include/lcd.h b/include/lcd.h index f054cac..8048419 100644 --- a/include/lcd.h +++ b/include/lcd.h @@ -75,8 +75,6 @@ typedef struct vidinfo { u_char vl_wbf; /* Wait between frames */ } vidinfo_t; -extern vidinfo_t panel_info; - #elif defined CONFIG_PXA250 /* * PXA LCD DMA descriptor @@ -146,8 +144,6 @@ typedef struct vidinfo { struct pxafb_info pxa; } vidinfo_t; -extern vidinfo_t panel_info; - #elif defined(CONFIG_ATMEL_LCD) typedef struct vidinfo { @@ -173,8 +169,6 @@ typedef struct vidinfo { u_long mmio; /* Memory mapped registers */ } vidinfo_t; -extern vidinfo_t panel_info; - #else typedef struct vidinfo { @@ -190,6 +184,8 @@ typedef struct vidinfo { #endif /* CONFIG_MPC823, CONFIG_PXA250 or CONFIG_MCC200 or CONFIG_ATMEL_LCD */ +extern vidinfo_t panel_info; + /* Video functions */ #if defined(CONFIG_RBC823) -- 1.6.0.2 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [U-boot][PATCH] AMCC ppc4xx /PLLOUTB/CPU clock/ Default bootstrap options A, B, C, D
Unstable 440EPx operation due to default bootsrtap options settings. The 440EPx fixed bootstrap options A,B,C,D sets PLL FWDVA to a value 1 that results PLLOUTB being greater than the CPU clock frequency. This results unstable 440EPx operation causing hang conditions. This is a patch fixing this problem. The patch touches two files speed.c and cpu_init.c. Signed off by Rupjyoti Sarmah rsar...@amcc.com from Applied Micro -- diff --git a/u-boot-2009.06/cpu/ppc4xx/cpu_init.c b/u-boot-2009.06/cpu/ppc4xx/cpu_init.c old mode 100644 new mode 100755 index 577d33f..550f6dc --- a/u-boot-2009.06/cpu/ppc4xx/cpu_init.c +++ b/u-boot-2009.06/cpu/ppc4xx/cpu_init.c @@ -1,337 +1,462 @@ + /* + * (C) Copyright 2000-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 common.h +#include watchdog.h +#include ppc4xx_enet.h +#include asm/processor.h +#include asm/gpio.h +#include ppc4xx.h + +#if defined(CONFIG_405GP) || defined(CONFIG_405EP) +DECLARE_GLOBAL_DATA_PTR; +#endif + +#ifndef CFG_PLL_RECONFIG +#define CFG_PLL_RECONFIG 0 +#endif +#define BOOT_STRAP_OPTION_A 0x +#define BOOT_STRAP_OPTION_B 0x0001 +#define BOOT_STRAP_OPTION_D 0x0003 +#define BOOT_STRAP_OPTION_E 0x0004 +void reconfigure_pll(u32 new_cpu_freq) +{ +#if defined(CONFIG_440EPX) + int reset_needed = 0; + u32 reg, temp; + u32 prbdv0, target_prbdv0, /* CLK_PRIMBD */ + fwdva, target_fwdva, fwdvb, target_fwdvb, /* CLK_PLLD */ + fbdv, target_fbdv, lfbdv, target_lfbdv, + perdv0, target_perdv0, /* CLK_PERD */ + spcid0, target_spcid0; /* CLK_SPCID */ + + + /* Reconfigure clocks if necessary. +* See PPC440EPx User's Manual, sections 8.2 and 14 */ + if (new_cpu_freq == 667) { + target_prbdv0 = 2; + target_fwdva = 2; + target_fwdvb = 4; + target_fbdv = 20; + target_lfbdv = 1; + target_perdv0 = 4; + target_spcid0 = 4; + + mfcpr(clk_primbd, reg); + temp = (reg PRBDV_MASK) 24; + prbdv0 = temp ? temp : 8; + if (prbdv0 != target_prbdv0) { + reg = ~PRBDV_MASK; + reg |= ((target_prbdv0 == 8 ? 0 : target_prbdv0) 24); + mtcpr(clk_primbd, reg); + reset_needed = 1; + } + + mfcpr(clk_plld, reg); + + temp = (reg PLLD_FWDVA_MASK) 16; + fwdva = temp ? temp : 16; + + temp = (reg PLLD_FWDVB_MASK) 8; + fwdvb = temp ? temp : 8; + + temp = (reg PLLD_FBDV_MASK) 24; + fbdv = temp ? temp : 32; + + temp = (reg PLLD_LFBDV_MASK); + lfbdv = temp ? temp : 64; + + if (fwdva != target_fwdva || fbdv != target_fbdv || lfbdv != target_lfbdv) { + reg = ~(PLLD_FWDVA_MASK | PLLD_FWDVB_MASK | +PLLD_FBDV_MASK | PLLD_LFBDV_MASK); + reg |= ((target_fwdva == 16 ? 0 : target_fwdva) 16) | + ((target_fwdvb == 8 ? 0 : target_fwdvb) 8) | + ((target_fbdv == 32 ? 0 : target_fbdv) 24) | + (target_lfbdv == 64 ? 0 : target_lfbdv); + mtcpr(clk_plld, reg); + reset_needed = 1; + } + + mfcpr(clk_perd, reg); + perdv0 = (reg CPR0_PERD_PERDV0_MASK) 24; + if (perdv0 != target_perdv0) { + reg = ~CPR0_PERD_PERDV0_MASK; + reg |= (target_perdv0 24); + mtcpr(clk_perd, reg); + reset_needed = 1; + } + + mfcpr(clk_spcid, reg); + temp = (reg CPR0_SPCID_SPCIDV0_MASK) 24; + spcid0
[U-Boot] [U-boot][PATCH] AMCC ppc440SPe PCIe PLL lock error
u-boot reports a PCIE PLL lock error at boot time on Yucca board, and left PCIe nonfunctional. This is fixed by making u-boot function ppc4xx_init_pcie() to wait 300 uS after negating reset before the first check of PLL lock. This fix touches only one file 4xx_pcie.c Signed off by Rupjyoti Sarmah rsar...@amcc.com from Applied Micro diff --git a/u-boot-2009.06/cpu/ppc4xx/4xx_pcie.c b/u-boot-2009.06/cpu/ppc4xx/4xx_pcie.c old mode 100644 new mode 100755 index 07fbb0e..51a5fd2 --- a/u-boot-2009.06/cpu/ppc4xx/4xx_pcie.c +++ b/u-boot-2009.06/cpu/ppc4xx/4xx_pcie.c @@ -1,1171 +1,1179 @@ +/* + * (C) Copyright 2006 - 2008 + * Wolfgang Denk, DENX Software Engineering, w...@denx.de. + * + * Copyright (c) 2005 Cisco Systems. All rights reserved. + * Roland Dreier rola...@cisco.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. + * + */ + +/* define DEBUG for debugging output (obviously ;-)) */ +#if 0 +#define DEBUG +#endif + +#include common.h +#include pci.h +#include ppc4xx.h +#include asm/processor.h +#include asm-ppc/io.h + +#if (defined(CONFIG_440SPE) || defined(CONFIG_405EX) ||\ +defined(CONFIG_460EX) || defined(CONFIG_460GT)) \ +defined(CONFIG_PCI) !defined(CONFIG_PCI_DISABLE_PCIE) + +#include asm/4xx_pcie.h + +enum { + PTYPE_ENDPOINT = 0x0, + PTYPE_LEGACY_ENDPOINT = 0x1, + PTYPE_ROOT_PORT = 0x4, + + LNKW_X1 = 0x1, + LNKW_X4 = 0x4, + LNKW_X8 = 0x8 +}; + +static int validate_endpoint(struct pci_controller *hose) +{ + if (hose-cfg_data == (u8 *)CONFIG_SYS_PCIE0_CFGBASE) + return (is_end_point(0)); + else if (hose-cfg_data == (u8 *)CONFIG_SYS_PCIE1_CFGBASE) + return (is_end_point(1)); +#if CONFIG_SYS_PCIE_NR_PORTS 2 + else if (hose-cfg_data == (u8 *)CONFIG_SYS_PCIE2_CFGBASE) + return (is_end_point(2)); +#endif + + return 0; +} + +static u8* pcie_get_base(struct pci_controller *hose, unsigned int devfn) +{ + u8 *base = (u8*)hose-cfg_data; + + /* use local configuration space for the first bus */ + if (PCI_BUS(devfn) == 0) { + if (hose-cfg_data == (u8*)CONFIG_SYS_PCIE0_CFGBASE) + base = (u8*)CONFIG_SYS_PCIE0_XCFGBASE; + if (hose-cfg_data == (u8*)CONFIG_SYS_PCIE1_CFGBASE) + base = (u8*)CONFIG_SYS_PCIE1_XCFGBASE; +#if CONFIG_SYS_PCIE_NR_PORTS 2 + if (hose-cfg_data == (u8*)CONFIG_SYS_PCIE2_CFGBASE) + base = (u8*)CONFIG_SYS_PCIE2_XCFGBASE; +#endif + } + + return base; +} + +static void pcie_dmer_disable(void) +{ + mtdcr (DCRN_PEGPL_CFG(DCRN_PCIE0_BASE), + mfdcr (DCRN_PEGPL_CFG(DCRN_PCIE0_BASE)) | GPL_DMER_MASK_DISA); + mtdcr (DCRN_PEGPL_CFG(DCRN_PCIE1_BASE), + mfdcr (DCRN_PEGPL_CFG(DCRN_PCIE1_BASE)) | GPL_DMER_MASK_DISA); +#if CONFIG_SYS_PCIE_NR_PORTS 2 + mtdcr (DCRN_PEGPL_CFG(DCRN_PCIE2_BASE), + mfdcr (DCRN_PEGPL_CFG(DCRN_PCIE2_BASE)) | GPL_DMER_MASK_DISA); +#endif +} + +static void pcie_dmer_enable(void) +{ + mtdcr (DCRN_PEGPL_CFG (DCRN_PCIE0_BASE), + mfdcr (DCRN_PEGPL_CFG(DCRN_PCIE0_BASE)) ~GPL_DMER_MASK_DISA); + mtdcr (DCRN_PEGPL_CFG (DCRN_PCIE1_BASE), + mfdcr (DCRN_PEGPL_CFG(DCRN_PCIE1_BASE)) ~GPL_DMER_MASK_DISA); +#if CONFIG_SYS_PCIE_NR_PORTS 2 + mtdcr (DCRN_PEGPL_CFG (DCRN_PCIE2_BASE), + mfdcr (DCRN_PEGPL_CFG(DCRN_PCIE2_BASE)) ~GPL_DMER_MASK_DISA); +#endif +} + +static int pcie_read_config(struct pci_controller *hose, unsigned int devfn, + int offset, int len, u32 *val) { + + u8 *address; + *val = 0; + + if (validate_endpoint(hose)) + return 0; /* No upstream config access */ + + /* +* Bus numbers are relative to hose-first_busno +*/ + devfn -= PCI_BDF(hose-first_busno, 0, 0); + + /* +* NOTICE: configuration space ranges are currenlty mapped only for +* the first 16 buses, so such limit must be imposed. In case more +* buses are required the TLB settings in board/amcc/board/init.S +* need to be altered accordingly (one bus takes 1 MB of memory space). +*/ + if (PCI_BUS(devfn) = 16) + return 0; + + /* +* Only single
Re: [U-Boot] [U-boot][PATCH] AMCC ppc4xx /PLLOUTB/CPU clock/ Default bootstrap options A, B, C, D
Two more: 1) you do not need to add [U-Boot] to your subject. That's done automatically. 2) patches for the 4xx architecture should have a ppc4xx: prefix and not AMCC Matthias On Tuesday 21 July 2009 14:20, Rupjyoti Sarmah wrote: Unstable 440EPx operation due to default bootsrtap options settings. The 440EPx fixed bootstrap options A,B,C,D sets PLL FWDVA to a value 1 that results PLLOUTB being greater than the CPU clock frequency. This results unstable 440EPx operation causing hang conditions. This is a patch fixing this problem. The patch touches two files speed.c and cpu_init.c. Signed off by Rupjyoti Sarmah rsar...@amcc.com from Applied Micro ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [U-boot][PATCH] AMCC ppc4xx /PLLOUTB/CPU clock/ Default bootstrap options A, B, C, D
Hi Rupjyoti, On Tuesday 21 July 2009 14:20, Rupjyoti Sarmah wrote: Unstable 440EPx operation due to default bootsrtap options settings. The 440EPx fixed bootstrap options A,B,C,D sets PLL FWDVA to a value 1 that results PLLOUTB being greater than the CPU clock frequency. This results unstable 440EPx operation causing hang conditions. This is a patch fixing this problem. The patch touches two files speed.c and cpu_init.c. Signed off by Rupjyoti Sarmah rsar...@amcc.com from Applied Micro -- diff --git a/u-boot-2009.06/cpu/ppc4xx/cpu_init.c b/u-boot-2009.06/cpu/ppc4xx/cpu_init.c old mode 100644 new mode 100755 index 577d33f..550f6dc --- a/u-boot-2009.06/cpu/ppc4xx/cpu_init.c +++ b/u-boot-2009.06/cpu/ppc4xx/cpu_init.c @@ -1,337 +1,462 @@ Your patch seems to readd the complete files. I dare to say it's because you edited this file on a wind**s maschine and it finally got execution permission. Please resubmit a proper patch. Matthias ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ppc4xx: Fix EEPROM configuration on Kilauea
Kilauea has an AT24C02 EEPROM which has an 8 byte page. Without defining CONFIG_SYS_EEPROM_PAGE_WRITE_BITS to 3 the eeprom command doesn't work correctly. Signed-off-by: Stefan Roese s...@denx.de --- include/configs/kilauea.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/include/configs/kilauea.h b/include/configs/kilauea.h index df1b061..1e7e731 100644 --- a/include/configs/kilauea.h +++ b/include/configs/kilauea.h @@ -374,9 +374,10 @@ *--*/ #define CONFIG_SYS_I2C_SPEED 40 /* I2C speed and slave address */ -#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 6 /* 24C02 requires 5ms delay */ #define CONFIG_SYS_I2C_EEPROM_ADDR 0x52/* I2C boot EEPROM (24C02BN) */ #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 1 /* Bytes of address */ +#define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS 3 +#define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS 10 /* Standard DTT sensor configuration */ #define CONFIG_DTT_DS1775 1 -- 1.6.3.3 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] ppc4xx: Add chip_config command to AMCC Kilauea eval board
This patch removes the alterpll command and replaces it with the now ppc4xx standard chip_config command to configure the I2C bootstrap EEPROM. Signed-off-by: Stefan Roese s...@denx.de --- board/amcc/kilauea/Makefile |4 +- board/amcc/kilauea/chip_config.c | 49 +++ board/amcc/kilauea/cmd_pll.c | 297 -- include/configs/kilauea.h|6 + 4 files changed, 58 insertions(+), 298 deletions(-) create mode 100644 board/amcc/kilauea/chip_config.c delete mode 100644 board/amcc/kilauea/cmd_pll.c diff --git a/board/amcc/kilauea/Makefile b/board/amcc/kilauea/Makefile index df0a68f..751e9f3 100644 --- a/board/amcc/kilauea/Makefile +++ b/board/amcc/kilauea/Makefile @@ -25,8 +25,10 @@ include $(TOPDIR)/config.mk LIB= $(obj)lib$(BOARD).a -COBJS = $(BOARD).o cmd_pll.o +COBJS-y:= $(BOARD).o +COBJS-$(CONFIG_CMD_CHIP_CONFIG) += chip_config.o +COBJS := $(COBJS-y) SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS)) diff --git a/board/amcc/kilauea/chip_config.c b/board/amcc/kilauea/chip_config.c new file mode 100644 index 000..881ad4b --- /dev/null +++ b/board/amcc/kilauea/chip_config.c @@ -0,0 +1,49 @@ +/* + * (C) Copyright 2009 + * Stefan Roese, DENX Software Engineering, s...@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 common.h +#include asm/ppc4xx_config.h + +struct ppc4xx_config ppc4xx_config_val[] = { + { 333-nor,NOR CPU: 333 PLB: 166 OPB: 83 EBC: 83, + { 0x8c, 0x12, 0xec, 0x12, 0x98, 0x00, 0x0a, 0x00, + 0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00 } }, + { 400-133-nor, NOR CPU: 400 PLB: 133 OPB: 66 EBC: 66, + { 0x8e, 0x0e, 0xe8, 0x13, 0x98, 0x00, 0x0a, 0x00, + 0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00 } }, + { 400-nor, NOR CPU: 400 PLB: 200 OPB: 100 EBC: 100, + { 0x8e, 0x0e, 0xe8, 0x12, 0x98, 0x00, 0x0a, 0x00, + 0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00 } }, + { 533-nor, NOR CPU: 533 PLB: 177 OPB: 88 EBC: 88, + { 0x8e, 0x43, 0x60, 0x13, 0x98, 0x00, 0x0a, 0x00, + 0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00 } }, + { 600-nor, NOR CPU: 600 PLB: 200 OPB: 100 EBC: 100, + { 0x8d, 0x02, 0x34, 0x13, 0x98, 0x00, 0x0a, 0x00, + 0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00 } }, + { 666-nor, NOR CPU: 666 PLB: 222 OPB: 111 EBC: 111, + { 0x8d, 0x03, 0x78, 0x13, 0x98, 0x00, 0x0a, 0x00, + 0x40, 0x08, 0x23, 0x50, 0x00, 0x05, 0x00, 0x00 } }, +}; + +int ppc4xx_config_count = ARRAY_SIZE(ppc4xx_config_val); diff --git a/board/amcc/kilauea/cmd_pll.c b/board/amcc/kilauea/cmd_pll.c deleted file mode 100644 index 9bae67e..000 --- a/board/amcc/kilauea/cmd_pll.c +++ /dev/null @@ -1,297 +0,0 @@ -/* - * (C) Copyright 2000, 2001 - * 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 - * - */ - -/* - * ehnus: change pll frequency. - * Wed Sep 5 11:45:17 CST 2007 - * h...@udtech.com.cn - */ - - -#include common.h -#include config.h -#include command.h -#include i2c.h - -#ifdef CONFIG_CMD_EEPROM - -#define EEPROM_CONF_OFFSET 0 -#define EEPROM_TEST_OFFSET 16 -#define EEPROM_SDSTP_PARAM 16 - -#define PLL_NAME_MAX 12 -#define BUF_STEP 8 - -/* eeprom_wirtes 8Byte per op. */ -#define
Re: [U-Boot] [PATCH 2/2] P2020RDB Platform Support Added
Dear Poonam Aggrwal, In message 1248173285-30560-1-git-send-email-poonam.aggr...@freescale.com you wrote: The code base is generic to add more P1_P2 RDB platforms support as and when required. The folder and file names are such that they can cater to future SOCs of P1/P2 family. Tested the following on P2020RDB: 1. eTSECs(1/2/3) 2. DDR, NAND, NOR, I2C etc Signed-off-by: Poonam Aggrwal poonam.aggr...@freescale.com --- MAINTAINERS |4 + MAKEALL |1 + Makefile |8 + board/freescale/p1_p2_rdb/Makefile| 53 +++ board/freescale/p1_p2_rdb/config.mk | 32 ++ board/freescale/p1_p2_rdb/ddr.c | 188 ++ board/freescale/p1_p2_rdb/law.c | 37 ++ board/freescale/p1_p2_rdb/p1_p2_rdb.c | 234 board/freescale/p1_p2_rdb/pci.c | 174 + board/freescale/p1_p2_rdb/tlb.c | 79 + board/freescale/p1_p2_rdb/u-boot.lds | 143 doc/README.p2020rdb | 143 include/configs/P1_P2_RDB.h | 625 + 13 files changed, 1721 insertions(+), 0 deletions(-) create mode 100644 board/freescale/p1_p2_rdb/Makefile create mode 100644 board/freescale/p1_p2_rdb/config.mk create mode 100644 board/freescale/p1_p2_rdb/ddr.c create mode 100644 board/freescale/p1_p2_rdb/law.c create mode 100644 board/freescale/p1_p2_rdb/p1_p2_rdb.c create mode 100644 board/freescale/p1_p2_rdb/pci.c create mode 100644 board/freescale/p1_p2_rdb/tlb.c create mode 100644 board/freescale/p1_p2_rdb/u-boot.lds create mode 100644 doc/README.p2020rdb create mode 100644 include/configs/P1_P2_RDB.h diff --git a/MAINTAINERS b/MAINTAINERS index 705bac5..814912c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -436,6 +436,10 @@ Peter Tyser pty...@xes-inc.com XPEDITE5200 MPC8548 XPEDITE5370 MPC8572 +Poonam Aggrwal poonam.aggr...@freescale.com + + P2020RDBP2020 + David Updegraff d...@cray.com Please keep list sorted by names. diff --git a/Makefile b/Makefile index 2a06440..dc3e987 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ # +# Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. Please note that 1) I don't think that you have any real right to add a (C) note to this file for just adding anothe rboard entry. 2) Your copyright note, especially the phrase All rights reserved. is incompatible with the GPL. We cannot accept any such code. Plase make sure never to use that in any submissions to this project, as we can then only relect your code. diff --git a/board/freescale/p1_p2_rdb/ddr.c b/board/freescale/p1_p2_rdb/ddr.c new file mode 100644 index 000..2b880ab --- /dev/null +++ b/board/freescale/p1_p2_rdb/ddr.c @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2009 Freescale Semiconductor, Inc. All rights reserved. + * + * 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 common.h +#include asm/mmu.h +#include asm/immap_85xx.h +#include asm/fsl_ddr_sdram.h +#include asm/io.h +#include asm/fsl_law.h + + +#if defined(CONFIG_DDR_ECC) !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER) +extern void ddr_enable_ecc(unsigned int dram_size); +#endif + +phys_size_t fixed_sdram(void); + +unsigned long get_board_ddr_size(ulong dummy) +{ + return 1024; +} Please use auto-detection of the memory size (using get_ram_size()). +phys_size_t initdram(int board_type) +{ + phys_size_t dram_size = 0; + + puts(Initializing); Please delete this - be less verbose. +phys_size_t fixed_sdram (void) +{ + Delete such emtpy lines. ... + return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024; +} Again - please use auto-sizing of the memory. +int board_early_init_f (void) +{ +#ifdef CONFIG_MMC + volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); + + setbits_be32(gur-pmuxcr, + (MPC85xx_PMUXCR_SDHC_CD | + MPC85xx_PMUXCR_SDHC_WP)); +#endif + return 0; +} I suggest you don't enable CONFIG_BOARD_EARLY_INIT_F at all when
Re: [U-Boot] [PATCH] ppc: Unlock cache-as-ram in a consistent manner
On Jul 20, 2009, at 6:44 PM, Liu Dave-R63238 wrote: I've tested this on 86xx boards, it'd be great if someone could test on 83xx and 74xx/7xx. 85xx boards should not be affected by this change. This change assumes http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/63423 has already been applied, or the lib/ppc patches in the diffs below can be changed to lib_ppc. I'm afraid some 83xx boards will not work after the patch is applied. It is some was assuming the data cache locked. (that is cache-inhibited) Are you just concerned, or did you actually test the patch, with negative results? I'm just concerned. I didn't test the patch. I still don't understand the concern. I think we should go ahead with this patch and if it really shows an issue we can revert it. However, I'm really dont know under what situation that a board has defined CONFIG_SYS_INIT_RAM_LOCK that unlock_ram_in_cache() once we are running in RAM should be an issue. - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 4/4] 85xx, 86xx: Add common board_add_ram_info()
On Jul 17, 2009, at 10:14 AM, Peter Tyser wrote: Previously, 85xx and 86xx boards would display DRAM information on bootup such as: ... I2C: ready DRAM: Memory controller interleaving enabled: Bank interleaving! 2 GB FLASH: 256 MB ... This patch moves the printing of the DRAM controller configuration to a common board_add_ram_info() function which prints out DDR type, width, CAS latency, and ECC mode. It also makes the DDR interleaving information print out in a more sane manner: ... I2C: ready DRAM: 2 GB (DDR2, 64-bit, CL=4, ECC on) DDR Controller Interleaving Mode: bank FLASH: 256 MB ... Signed-off-by: Peter Tyser pty...@xes-inc.com --- cpu/mpc8xxx/ddr/main.c | 43 + cpu/mpc8xxx/ddr/util.c | 96 +++ + 2 files changed, 98 insertions(+), 41 deletions(-) applied - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/4] xes: Remove 8xxx board_add_ram_info() function
On Jul 17, 2009, at 10:14 AM, Peter Tyser wrote: This is in preparation for adding one common 8xxx board_add_ram_info() fuction for all 8xxx boards Signed-off-by: Peter Tyser pty...@xes-inc.com --- board/xes/common/fsl_8xxx_ddr.c | 53 --- 1 files changed, 0 insertions(+), 53 deletions(-) applied - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/4] tqm85xx: Remove board_add_ram_info()
On Jul 17, 2009, at 10:14 AM, Peter Tyser wrote: This is in preparation for adding one common 8xxx board_add_ram_info() function for all 8xxx boards Signed-off-by: Peter Tyser pty...@xes-inc.com --- board/tqc/tqm85xx/sdram.c | 33 +++-- 1 files changed, 3 insertions(+), 30 deletions(-) applied - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/4] 86xx: Rename ccsr_ddr's sdram_mode_1, sdram_cfg_1 fields
On Jul 17, 2009, at 10:14 AM, Peter Tyser wrote: Rename sdram_mode_1 to sdram_mode and sdram_cfg_1 to sdram_cfg to match the 86xx user's manual and other Freescale architectures Signed-off-by: Peter Tyser pty...@xes-inc.com --- board/freescale/mpc8610hpcd/mpc8610hpcd.c |4 ++-- board/freescale/mpc8641hpcn/mpc8641hpcn.c |6 +++--- board/sbc8641d/sbc8641d.c | 12 ++-- cpu/mpc86xx/ddr-8641.c|4 ++-- include/asm-ppc/immap_86xx.h |4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) applied - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] PATCH 2/2] Add pci/pcie E1000 ethernet support for MPC8544DS and MPC8536 boards
On Jul 8, 2009, at 9:05 PM, Roy Zang wrote: correct ? :) It is 8544DS board. Thanks. Sorry for the mistake. It is my oversight when I regenerate the patch before send out. Pick up this one: From: Roy Zang tie-fei.z...@freescale.com Add pci/pcie E1000 ethernet support for MPC8544DS and MPC8536 boards. Signed-off-by: Roy Zang tie-fei.z...@freescale.com --- include/configs/MPC8536DS.h |1 + include/configs/MPC8544DS.h |1 + 2 files changed, 2 insertions(+), 0 deletions(-) applied - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/2] Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
On Jul 21, 2009, at 6:52 AM, Wolfgang Denk wrote: diff --git a/include/asm-ppc/config.h b/include/asm-ppc/config.h index ca143c7..b799a22 100644 --- a/include/asm-ppc/config.h +++ b/include/asm-ppc/config.h @@ -37,4 +37,45 @@ #endif #endif +#if defined(CONFIG_MPC8533) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8535) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8536) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8540) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8541) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8543) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8544) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8545) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8547) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8548) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8555) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8560) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8567) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8568) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8569) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8572) +#define CONFIG_MAX_CPUS 2 +#elif defined(CONFIG_P2020) +#define CONFIG_MAX_CPUS 2 + +#elif defined(CONFIG_MPC8610) +#define CONFIG_MAX_CPUS 1 +#elif defined(CONFIG_MPC8641) +#define CONFIG_MAX_CPUS 2 +#endif Sorry, but this does not scale. Please find a better solution. is there a better solution? We effectively do things like this in the board CONFIG.h and its just duplicated for every board. Here its just isolated. Just wondering if you had any suggestions (I agree its ugly and if/when we get Kconfig its something that could be put there). - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 1/3] xpedite5200, 5370: Use buffered NOR flash writes
On Jul 19, 2009, at 7:17 PM, pty...@xes-inc.com wrote: From: Peter Tyser pty...@xes-inc.com Buffered writes are possible on the XPedite5200 and XPedite5370 and greatly improve NOR flash write speeds Signed-off-by: Peter Tyser pty...@xes-inc.com --- I miscalculated the merge window close time... I hope to slip these last 3 trivial changes in the upcoming release if possible. Thanks, Peter applied - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] xpedite5370: Fix I2C GPIO initialization typo
On Jul 19, 2009, at 7:17 PM, pty...@xes-inc.com wrote: From: Peter Tyser pty...@xes-inc.com Signed-off-by: Peter Tyser pty...@xes-inc.com --- board/xes/xpedite5370/xpedite5370.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) applied - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] Copyright/License text in cpu/ppc4xx/4xx_pci.c
Gentlemen, First, my apologies for ignoring this thread for so long. As I recall, I was the person that added this file to ppcboot almost 7 years ago when I added the first Book E support. Matthias Fuchs wrote: Did you have a look into include ppc440.h? I took a pretty close look. There's still considerable original content in the current file. But the amount doesn't matter, it's a derivative work, period. It contains the old IBM copyright and (!!!) a GPL header with copyrights from five IBM people. Hmm, does this bring us any further? I don't see any incompatibility with GPL here ... nor did I see any issues 7 years ago. The clause, No license under IBM patents or patent applications is to be implied by the copyright license. does not throw a monkey wrench into u-boot as the royalty-free redistribution of the _code_ is not affected. In fact, the IBM notice clearly states: Anyone receiving this source is licensed under IBM copyrights to use it in any way he or she deems fit, including copying it, modifying it, compiling it, and redistributing it either with or without modifications. IBM is simply making it clear that the copyright does not imply coverage of their patented or patent-pending inventions and/or processes (i.e. that copyright applies only to the code). In any case, I appreciate these discussions -- they are vital to maintaining a clean household and help improve our overall discipline ... which can wane from time to time. Regards, --Scott ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v3 0/8] hwconfig and some its users
On Jul 16, 2009, at 4:06 PM, Anton Vorontsov wrote: On Thu, Jul 16, 2009 at 10:52:13PM +0200, Wolfgang Denk wrote: Dear Kim Phillips, In message 20090707173804.acc352f9.kim.phill...@freescale.com you wrote: Any news on this? Wolfgang, if you have no objection, please apply directly. Done. Thanks a lot, Wolfgang! Anton, Do we need some version of these patches for MPC8536 DS eSDHC support? - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Please pull u-boot-mpc85xx
The following changes since commit d4abc757c26c531293f5bbc4262ade44a317eec9: Peter Tyser (1): Move api_examples to examples/api are available in the git repository at: git://git.denx.de/u-boot-mpc85xx.git master Kumar Gala (3): 85xx: Bump up the BOOTMAP to 16M on FSL 85xx boards 85xx: Report which bank of NOR flash we are booting from on FSL boards 86xx: Report which bank of NOR flash we are booting from on MPC8641HPCN Peter Tyser (6): 86xx: Rename ccsr_ddr's sdram_mode_1, sdram_cfg_1 fields xes: Remove 8xxx board_add_ram_info() function tqm85xx: Remove board_add_ram_info() 85xx, 86xx: Add common board_add_ram_info() xpedite5200,5370: Use buffered NOR flash writes xpedite5370: Fix I2C GPIO initialization typo Roy Zang (1): 85xx: Add pci/pcie E1000 ethernet support for MPC8544DS and MPC8536 boards board/freescale/mpc8536ds/mpc8536ds.c | 18 +- board/freescale/mpc8544ds/mpc8544ds.c | 11 +++- board/freescale/mpc8572ds/mpc8572ds.c | 21 ++- board/freescale/mpc8610hpcd/mpc8610hpcd.c |4 +- board/freescale/mpc8641hpcn/mpc8641hpcn.c | 19 -- board/freescale/p2020ds/p2020ds.c | 12 +++- board/sbc8641d/sbc8641d.c | 12 ++-- board/tqc/tqm85xx/sdram.c | 33 +- board/xes/common/fsl_8xxx_ddr.c | 53 board/xes/xpedite5370/xpedite5370.c |4 +- cpu/mpc86xx/ddr-8641.c|4 +- cpu/mpc8xxx/ddr/main.c| 43 + cpu/mpc8xxx/ddr/util.c| 96 + include/asm-ppc/immap_86xx.h |4 +- include/configs/MPC8536DS.h |5 +- include/configs/MPC8540ADS.h |4 +- include/configs/MPC8541CDS.h |4 +- include/configs/MPC8544DS.h |5 +- include/configs/MPC8548CDS.h |4 +- include/configs/MPC8555CDS.h |4 +- include/configs/MPC8560ADS.h |4 +- include/configs/MPC8568MDS.h |4 +- include/configs/MPC8569MDS.h |4 +- include/configs/MPC8572DS.h |4 +- include/configs/P2020DS.h |4 +- include/configs/XPEDITE5200.h |1 + include/configs/XPEDITE5370.h |1 + 27 files changed, 211 insertions(+), 171 deletions(-) ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] 86xx: Report which bank of NOR flash we are booting from on MPC8641HPCN
The MPC8641HPCN board is capable of swizzling the upper address bit of the NOR flash we boot out of which creates the concept of virtual banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in bank 0. The PIXIS FPGA exposes registers on LBC which we can use to determine which bank we are booting out of (as well as setting which bank to boot out of). Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- board/freescale/mpc8641hpcn/mpc8641hpcn.c | 13 +++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 7422e6b..d115ce1 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -42,10 +42,19 @@ int board_early_init_f(void) int checkboard(void) { - printf (Board: MPC8641HPCN, System ID: 0x%02x, - System Version: 0x%02x, FPGA Version: 0x%02x\n, + u8 vboot; + + printf (Board: MPC8641HPCN, Sys ID: 0x%02x, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), in8(PIXIS_BASE + PIXIS_PVER)); + + vboot = in8(PIXIS_BASE + 0x16); + if ((vboot 7) 0x1) + printf (vBank: %d\n, ((vboot 6) 0x1)); + else + puts (Promjet\n); + #ifdef CONFIG_PHYS_64BIT printf ( 36-bit physical address map\n); #endif -- 1.6.0.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] 85xx: Report which bank of NOR flash we are booting from on FSL boards
The p2020DS, MPC8536DS, MPC8572DS, MPC8544DS boards are capable of swizzling the upper address bits of the NOR flash we boot out of which creates the concept of virtual banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in bank 0. The PIXIS FPGA exposes registers on LBC which we can use to determine which bank we are booting out of (as well as setting which bank to boot out of). Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- * This is a merged version of previous patches that covers all the 85xx boards board/freescale/mpc8536ds/mpc8536ds.c | 18 -- board/freescale/mpc8544ds/mpc8544ds.c | 11 +-- board/freescale/mpc8572ds/mpc8572ds.c | 21 - board/freescale/p2020ds/p2020ds.c | 12 +++- 4 files changed, 56 insertions(+), 6 deletions(-) diff --git a/board/freescale/mpc8536ds/mpc8536ds.c b/board/freescale/mpc8536ds/mpc8536ds.c index 28b27ee..91fb87b 100644 --- a/board/freescale/mpc8536ds/mpc8536ds.c +++ b/board/freescale/mpc8536ds/mpc8536ds.c @@ -60,10 +60,24 @@ int board_early_init_f (void) int checkboard (void) { - printf (Board: MPC8536DS, System ID: 0x%02x, - System Version: 0x%02x, FPGA Version: 0x%02x\n, + u8 vboot; + + puts(Board: MPC8536DS ); +#ifdef CONFIG_PHYS_64BIT + puts((36-bit addrmap) ); +#endif + + printf (Sys ID: 0x%02x, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), in8(PIXIS_BASE + PIXIS_PVER)); + + vboot = in8(PIXIS_BASE + 0x16); + if ((vboot 7) 0x1) + puts (Promjet\n); + else + printf (vBank: %d\n, ((vboot 5) 0x3)); + return 0; } diff --git a/board/freescale/mpc8544ds/mpc8544ds.c b/board/freescale/mpc8544ds/mpc8544ds.c index 34bdbad..5a199f7 100644 --- a/board/freescale/mpc8544ds/mpc8544ds.c +++ b/board/freescale/mpc8544ds/mpc8544ds.c @@ -43,15 +43,22 @@ int checkboard (void) volatile ccsr_gur_t *gur = (void *)(CONFIG_SYS_MPC85xx_GUTS_ADDR); volatile ccsr_lbc_t *lbc = (void *)(CONFIG_SYS_MPC85xx_LBC_ADDR); volatile ccsr_local_ecm_t *ecm = (void *)(CONFIG_SYS_MPC85xx_ECM_ADDR); + u8 vboot; if ((uint)gur-porpllsr != 0xe00e) { printf(immap size error %lx\n,(ulong)gur-porpllsr); } - printf (Board: MPC8544DS, System ID: 0x%02x, - System Version: 0x%02x, FPGA Version: 0x%02x\n, + printf (Board: MPC8544DS, Sys ID: 0x%02x, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), in8(PIXIS_BASE + PIXIS_PVER)); + vboot = in8(PIXIS_BASE + 0x16); + if ((vboot 7) 0x1) + printf (vBank: %d\n, ((vboot 6) 0x1)); + else + puts (Promjet\n); + lbc-ltesr = 0x;/* Clear LBC error interrupts */ lbc-lteir = 0x;/* Enable LBC error interrupts */ ecm-eedr = 0x; /* Clear ecm errors */ diff --git a/board/freescale/mpc8572ds/mpc8572ds.c b/board/freescale/mpc8572ds/mpc8572ds.c index 4b95617..1d4f9bb 100644 --- a/board/freescale/mpc8572ds/mpc8572ds.c +++ b/board/freescale/mpc8572ds/mpc8572ds.c @@ -42,14 +42,33 @@ long int fixed_sdram(void); int checkboard (void) { + u8 vboot; + puts (Board: MPC8572DS ); #ifdef CONFIG_PHYS_64BIT puts ((36-bit addrmap) ); #endif printf (Sys ID: 0x%02x, - Sys Ver: 0x%02x, FPGA Ver: 0x%02x\n, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), in8(PIXIS_BASE + PIXIS_PVER)); + + vboot = in8(PIXIS_BASE + 0x16); + switch (((vboot 6) 0x3)) { + case 0: + puts (vBank: 0\n); + break; + case 1: + puts (Promjet\n); + break; + case 2: + puts (NAND\n); + break; + case 3: + puts (vBank: 1\n); + break; + } + return 0; } diff --git a/board/freescale/p2020ds/p2020ds.c b/board/freescale/p2020ds/p2020ds.c index 293e5a4..292a820 100644 --- a/board/freescale/p2020ds/p2020ds.c +++ b/board/freescale/p2020ds/p2020ds.c @@ -47,14 +47,24 @@ phys_size_t fixed_sdram(void); int checkboard(void) { + u8 sw7; + puts(Board: P2020DS ); #ifdef CONFIG_PHYS_64BIT puts((36-bit addrmap) ); #endif + printf(Sys ID: 0x%02x, - Sys Ver: 0x%02x, FPGA Ver: 0x%02x\n, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER),
Re: [U-Boot] [PATCH 1/2] Removed CONFIG_NUM_CPUS for 85xx and 86xx Freescale processors.
Dear Kumar Gala, In message d46e33d8-e298-4c7f-bf99-1b0269148...@kernel.crashing.org you wrote: Sorry, but this does not scale. Please find a better solution. is there a better solution? We effectively do things like this in the board CONFIG.h and its just duplicated for every board. Here its just isolated. Just wondering if you had any suggestions (I agree its ugly and if/when we get Kconfig its something that could be put there). Well, no, sorry, I don't have any clever suggestion. It would at least be a bit shorter if you used #if defined(..) || defined(..) || defined(..) ... #define CONFIG_MAX_CPUS 1 #elif defined(..) || defined(..) || defined(..) ... #define CONFIG_MAX_CPUS 2 #else #error #endif 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 Today's robots are very primitive, capable of understanding only a few simple instructions such as 'go left', 'go right', and 'build car'. - John Sladek ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] 86xx: Report which bank of NOR flash we are booting from on MPC8641HPCN
Dear Kumar Gala, In message 1248187311-5943-1-git-send-email-ga...@kernel.crashing.org you wrote: The MPC8641HPCN board is capable of swizzling the upper address bit of the NOR flash we boot out of which creates the concept of virtual banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in bank 0. The PIXIS FPGA exposes registers on LBC which we can use to determine which bank we are booting out of (as well as setting which bank to boot out of). Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- board/freescale/mpc8641hpcn/mpc8641hpcn.c | 13 +++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 7422e6b..d115ce1 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -42,10 +42,19 @@ int board_early_init_f(void) int checkboard(void) { - printf (Board: MPC8641HPCN, System ID: 0x%02x, - System Version: 0x%02x, FPGA Version: 0x%02x\n, + u8 vboot; + + printf (Board: MPC8641HPCN, Sys ID: 0x%02x, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), in8(PIXIS_BASE + PIXIS_PVER)); + + vboot = in8(PIXIS_BASE + 0x16); ^^^ Maybe you can use a symbolic name here, too? + if ((vboot 7) 0x1) if (vboot 0x80) ??? + printf (vBank: %d\n, ((vboot 6) 0x1)); printf (vBank: %d\n, !!(vboot 0x40)); ??? And eventually you can even come up with symbolic names for the magic numbers 0x80 and 0x40 ? 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 egrep patterns are full regular expressions; it uses a fast determi- nistic algorithm that sometimes needs exponential space. - unix manuals ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 2/3] i2c, mpc83xx: add CONFIG_SYS_I2C_INIT_BOARD for fsl_i2c
Hello Heiko Heiko Schocher wrote: This patch adds the possibility to call a board specific i2c bus reset routine for the fsl_i2c bus driver, and adds this option for the keymile kmeter1 board. The deblock sequence for this board is implemented and tested in the following way: CR = 0x20 (release SDA and SCL pin) CR = 0xa0 (start read) dummy read dummy read if 2. dummy read == 0x00 3. dummy read CR = 0x80 (SDA and SCL now 1 SR = 0x86) CR = 0x00 (Modul reset SR=0x81) CR = 0x80 (SDA and SCL = 1, SR = 0x81) Signed-off-by: Heiko Schocher h...@denx.de --- board/keymile/common/common.c | 20 drivers/i2c/fsl_i2c.c |6 ++ include/configs/kmeter1.h |1 - 3 files changed, 26 insertions(+), 1 deletions(-) Applied to u-boot-i2c.git bye heiko -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Please pull u-boot-i2c.git
Hello Wolfgang, The following changes since commit 1bc1538613d66cef3cbce680fc8d7c3561a0fbd0: Peter Tyser (1): Move examples/ to examples/standalone are available in the git repository at: git://git.denx.de/u-boot-i2c.git master Heiko Schocher (1): i2c, mpc83xx: add CONFIG_SYS_I2C_INIT_BOARD for fsl_i2c board/keymile/common/common.c | 20 drivers/i2c/fsl_i2c.c |6 ++ include/configs/kmeter1.h |1 - 3 files changed, 26 insertions(+), 1 deletions(-) -- DENX Software Engineering GmbH, MD: Wolfgang Denk Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] 85xx: Report which bank of NOR flash we are booting from on FSL boards
Dear Kumar Gala, In message 1248187378-5970-1-git-send-email-ga...@kernel.crashing.org you wrote: The p2020DS, MPC8536DS, MPC8572DS, MPC8544DS boards are capable of swizzling the upper address bits of the NOR flash we boot out of which creates the concept of virtual banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in bank 0. The PIXIS FPGA exposes registers on LBC which we can use to determine which bank we are booting out of (as well as setting which bank to boot out of). Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- * This is a merged version of previous patches that covers all the 85xx boards board/freescale/mpc8536ds/mpc8536ds.c | 18 -- board/freescale/mpc8544ds/mpc8544ds.c | 11 +-- board/freescale/mpc8572ds/mpc8572ds.c | 21 - board/freescale/p2020ds/p2020ds.c | 12 +++- 4 files changed, 56 insertions(+), 6 deletions(-) diff --git a/board/freescale/mpc8536ds/mpc8536ds.c b/board/freescale/mpc8536ds/mpc8536ds.c index 28b27ee..91fb87b 100644 --- a/board/freescale/mpc8536ds/mpc8536ds.c +++ b/board/freescale/mpc8536ds/mpc8536ds.c @@ -60,10 +60,24 @@ int board_early_init_f (void) int checkboard (void) { - printf (Board: MPC8536DS, System ID: 0x%02x, - System Version: 0x%02x, FPGA Version: 0x%02x\n, + u8 vboot; + + puts(Board: MPC8536DS ); +#ifdef CONFIG_PHYS_64BIT + puts((36-bit addrmap) ); +#endif + + printf (Sys ID: 0x%02x, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), in8(PIXIS_BASE + PIXIS_PVER)); + + vboot = in8(PIXIS_BASE + 0x16); + if ((vboot 7) 0x1) + puts (Promjet\n); + else + printf (vBank: %d\n, ((vboot 5) 0x3)); + return 0; } So how many boards are copying this mostly identical code? How about factoring out the big common parts? 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 Mirrors should reflect a little before throwing back images. - Jean Cocteau ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHv4 3/3] 83xx, kmeter1: added NAND support
Signed-off-by: Heiko Schocher h...@denx.de --- - changes since v1: moved the nand driver to drivers/mtd/nand/kmeter1_nand.c as Stefan Roese suggested - changes since v2: added comments from Stefan Roese - drivers/mtd/nand/kmeter1_nand.c only gets compiled if CONFIG_NAND_KMETER1 is set in board config file - Fix Coding Style issue - changes since v3: added comments from Scott Wood - Coding Style issues - simplified accessor defines - simplified kpn_nand_hwcontrol() - rebased against current head drivers/mtd/nand/Makefile |1 + drivers/mtd/nand/kmeter1_nand.c | 135 +++ include/configs/kmeter1.h |6 ++ 3 files changed, 142 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/nand/kmeter1_nand.c diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index 89ccec2..d8e137b 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -39,6 +39,7 @@ COBJS-$(CONFIG_NAND_DAVINCI) += davinci_nand.o COBJS-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o COBJS-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o COBJS-$(CONFIG_NAND_KIRKWOOD) += kirkwood_nand.o +COBJS-$(CONFIG_NAND_KMETER1) += kmeter1_nand.o COBJS-$(CONFIG_NAND_MPC5121_NFC) += mpc5121_nfc.o COBJS-$(CONFIG_NAND_NDFC) += ndfc.o COBJS-$(CONFIG_NAND_NOMADIK) += nomadik.o diff --git a/drivers/mtd/nand/kmeter1_nand.c b/drivers/mtd/nand/kmeter1_nand.c new file mode 100644 index 000..e8e5b7b --- /dev/null +++ b/drivers/mtd/nand/kmeter1_nand.c @@ -0,0 +1,135 @@ +/* + * (C) Copyright 2009 + * Heiko Schocher, DENX Software Engineering, h...@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 common.h +#include nand.h +#include asm/io.h + +#define CONFIG_NAND_MODE_REG (void *)(CONFIG_SYS_NAND_BASE + 0x2) +#define CONFIG_NAND_DATA_REG (void *)(CONFIG_SYS_NAND_BASE + 0x3) + +#define read_mode()in_8(CONFIG_NAND_MODE_REG) +#define write_mode(val)out_8(CONFIG_NAND_MODE_REG, val) +#define read_data()in_8(CONFIG_NAND_DATA_REG) +#define write_data(val)out_8(CONFIG_NAND_DATA_REG, val) + +#define KPN_RDY2 (1 7) +#define KPN_RDY1 (1 6) +#define KPN_WPN(1 4) +#define KPN_CE2N (1 3) +#define KPN_CE1N (1 2) +#define KPN_ALE(1 1) +#define KPN_CLE(1 0) + +#define KPN_DEFAULT_CHIP_DELAY 50 + +static int kpn_chip_ready(void) +{ + if (read_mode() KPN_RDY1) + return 1; + + return 0; +} + +static void kpn_wait_rdy(void) +{ + int cnt = 100; + + while (--cnt !kpn_chip_ready()) + udelay(1); + + if (!cnt) + printf (timeout while waiting for RDY\n); +} + +static void kpn_nand_hwcontrol(struct mtd_info *mtd, int cmd, unsigned int ctrl) +{ + u8 reg_val = read_mode(); + + if (ctrl NAND_CTRL_CHANGE) { + reg_val = reg_val ~(KPN_ALE + KPN_CLE); + + if (ctrl NAND_CLE) + reg_val = reg_val | KPN_CLE; + if (ctrl NAND_ALE) + reg_val = reg_val | KPN_ALE; + if (ctrl NAND_NCE) + reg_val = reg_val ~KPN_CE1N; + else + reg_val = reg_val | KPN_CE1N; + + write_mode(reg_val); + } + if (cmd != NAND_CMD_NONE) + write_data(cmd); + + /* wait until flash is ready */ + kpn_wait_rdy(); +} + +static u_char kpn_nand_read_byte(struct mtd_info *mtd) +{ + return read_data(); +} + +static void kpn_nand_write_buf(struct mtd_info *mtd, const u_char *buf, int len) +{ + int i; + + for (i = 0; i len; i++) { + write_data(buf[i]); + kpn_wait_rdy(); + } +} + +static void kpn_nand_read_buf(struct mtd_info *mtd, u_char *buf, int len) +{ + int i; + + for (i = 0; i len; i++) + buf[i] = read_data(); +} + +static int kpn_nand_dev_ready(struct mtd_info *mtd) +{ + kpn_wait_rdy(); + + return 1; +} + +int board_nand_init(struct nand_chip *nand) +{ + nand-ecc.mode = NAND_ECC_SOFT; + + /* Reference hardware control function */ +
Re: [U-Boot] [PATCH] 86xx: Report which bank of NOR flash we are booting from on MPC8641HPCN
On Tuesday 21 July 2009 17:05:56 Wolfgang Denk wrote: int checkboard(void) { - printf (Board: MPC8641HPCN, System ID: 0x%02x, - System Version: 0x%02x, FPGA Version: 0x%02x\n, + u8 vboot; + + printf (Board: MPC8641HPCN, Sys ID: 0x%02x, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), in8(PIXIS_BASE + PIXIS_PVER)); + + vboot = in8(PIXIS_BASE + 0x16); ^^^ Maybe you can use a symbolic name here, too? + if ((vboot 7) 0x1) if (vboot 0x80) ??? + printf (vBank: %d\n, ((vboot 6) 0x1)); printf (vBank: %d\n, !!(vboot 0x40)); ??? And eventually you can even come up with symbolic names for the magic numbers 0x80 and 0x40 ? And please switch from using in8() to in_8(). Best regards, 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: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] fec_mxc: driver for FEC ethernet controller on i.MX27
Signed-off-by: Ilya Yanok ya...@emcraft.com --- cpu/arm926ejs/mx27/generic.c | 10 + drivers/net/Makefile |1 + drivers/net/fec_mxc.c| 742 ++ drivers/net/fec_mxc.h| 304 + include/netdev.h |1 + 5 files changed, 1058 insertions(+), 0 deletions(-) create mode 100644 drivers/net/fec_mxc.c create mode 100644 drivers/net/fec_mxc.h diff --git a/cpu/arm926ejs/mx27/generic.c b/cpu/arm926ejs/mx27/generic.c index bcf7899..47fa4b4 100644 --- a/cpu/arm926ejs/mx27/generic.c +++ b/cpu/arm926ejs/mx27/generic.c @@ -20,6 +20,7 @@ #include common.h #include div64.h +#include netdev.h #include asm/io.h #include asm/arch/imx-regs.h @@ -159,6 +160,15 @@ int print_cpuinfo (void) } #endif +int cpu_eth_init(bd_t *bis) +{ +#if defined(CONFIG_FEC_MXC) + return fecmxc_initialize(bis); +#else + return 0; +#endif +} + void imx_gpio_mode(int gpio_mode) { struct gpio_regs *regs = (struct gpio_regs *)IMX_GPIO_BASE; diff --git a/drivers/net/Makefile b/drivers/net/Makefile index c6097c3..f92dba7 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -37,6 +37,7 @@ COBJS-$(CONFIG_DNET) += dnet.o COBJS-$(CONFIG_E1000) += e1000.o COBJS-$(CONFIG_EEPRO100) += eepro100.o COBJS-$(CONFIG_ENC28J60) += enc28j60.o +COBJS-$(CONFIG_FEC_MXC) += fec_mxc.o COBJS-$(CONFIG_FSLDMAFEC) += fsl_mcdmafec.o mcfmii.o COBJS-$(CONFIG_GRETH) += greth.o COBJS-$(CONFIG_INCA_IP_SWITCH) += inca-ip_sw.o diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c new file mode 100644 index 000..faf008c --- /dev/null +++ b/drivers/net/fec_mxc.c @@ -0,0 +1,742 @@ +/* + * (C) Copyright 2009 Ilya Yanok, Emcraft Systems Ltd ya...@emcraft.com + * (C) Copyright 2008,2009 Eric Jarrige eric.jarr...@armadeus.org + * (C) Copyright 2008 Armadeus Systems nc + * (C) Copyright 2007 Pengutronix, Sascha Hauer s.ha...@pengutronix.de + * (C) Copyright 2007 Pengutronix, Juergen Beisert j.beis...@pengutronix.de + * + * 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 common.h +#include malloc.h +#include net.h +#include miiphy.h +#include fec_mxc.h + +#include asm/arch/clock.h +#include asm/arch/imx-regs.h +#include asm/io.h +#include asm/errno.h + +DECLARE_GLOBAL_DATA_PTR; + +#ifndef CONFIG_MII +#error CONFIG_MII has to be defined! +#endif + +#undef DEBUG + +struct nbuf { + uint8_t data[1500]; /** actual data */ + int length; /** actual length */ + int used; /** buffer in use or not */ + uint8_t head[16]; /** MAC header(6 + 6 + 2) + 2(aligned) */ +}; + +struct fec_priv gfec = { + .eth = (struct ethernet_regs *)IMX_FEC_BASE, + .xcv_type = MII100, + .rbd_base = NULL, + .rbd_index = 0, + .tbd_base = NULL, + .tbd_index = 0, + .bd= NULL, +}; + +/* + * MII-interface related functions + */ +static int fec_miiphy_read(char *dev, uint8_t phyAddr, uint8_t regAddr, + uint16_t *retVal) +{ + struct eth_device *edev = eth_get_dev_by_name(dev); + struct fec_priv *fec = (struct fec_priv *)edev-priv; + + uint32_t reg; /* convenient holder for the PHY register */ + uint32_t phy; /* convenient holder for the PHY */ + uint32_t start; + + /* +* reading from any PHY's register is done by properly +* programming the FEC's MII data register. +*/ + writel(FEC_IEVENT_MII, fec-eth-ievent); + reg = regAddr FEC_MII_DATA_RA_SHIFT; + phy = phyAddr FEC_MII_DATA_PA_SHIFT; + + writel(FEC_MII_DATA_ST | FEC_MII_DATA_OP_RD | FEC_MII_DATA_TA | + phy | reg, fec-eth-mii_data); + + /* +* wait for the related interrupt +*/ + start = get_timer_masked(); + while (!(readl(fec-eth-ievent) FEC_IEVENT_MII)) { + if (get_timer(start) (CONFIG_SYS_HZ / 1000)) { + printf(Read MDIO failed...\n); + return -1; + } + } + + /* +* clear mii interrupt bit +*/ + writel(FEC_IEVENT_MII, fec-eth-ievent); + + /* +* it's now safe to read the PHY's register +*/ + *retVal = readl(fec-eth-mii_data);
Re: [U-Boot] [RFC] CONFIG naming convetion
On Mon 20 Jul 2009 16:33, Wolfgang Denk pondered: Dear Robin Getz, [snip] You seem to live on a different planet than me. That is a well though out point. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/4] tools: mkimage: kwbimage list command support
Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- common/image.c |4 ++-- tools/kwbimage.c | 41 + tools/mkimage.c |7 ++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/common/image.c b/common/image.c index 845006f..e3ad3e5 100644 --- a/common/image.c +++ b/common/image.c @@ -159,7 +159,7 @@ static table_entry_t uimage_comp[] = { uint32_t crc32 (uint32_t, const unsigned char *, uint); uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint); -static void genimg_print_size (uint32_t size); +void genimg_print_size (uint32_t size); #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC) static void genimg_print_time (time_t timestamp); #endif @@ -473,7 +473,7 @@ void memmove_wd (void *to, void *from, size_t len, ulong chunksz) } #endif /* !USE_HOSTCC */ -static void genimg_print_size (uint32_t size) +void genimg_print_size (uint32_t size) { #ifndef USE_HOSTCC printf (%d Bytes = , size); diff --git a/tools/kwbimage.c b/tools/kwbimage.c index b1ad37a..13bd57f 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -33,6 +33,8 @@ #include unistd.h #include kwbimage.h +extern void genimg_print_size (uint32_t size); + static struct kwb_header kwbimage_header; static int datacmd_cnt = 0; @@ -262,3 +264,42 @@ void kwbimage_set_header (struct kwb_header *hdr, struct stat *sbuf, exthdr-checkSum = kwbimage_checksum8((void *)exthdr, sizeof(extbhr_t), 0); } + +/* -l support functions */ +int kwbimage_check_header (struct kwb_header *hdr) +{ + bhr_t *mhdr = hdr-kwb_hdr; + extbhr_t *exthdr = hdr-kwb_exthdr; + uint8_t calc_hdrcsum; + uint8_t calc_exthdrcsum; + + calc_hdrcsum = kwbimage_checksum8((void *)mhdr, + sizeof(bhr_t) - sizeof(uint8_t), 0); + if (calc_hdrcsum != mhdr-checkSum) { + return -1; /* main header csum not matched */ + } + calc_exthdrcsum = kwbimage_checksum8((void *)exthdr, + sizeof(extbhr_t) - sizeof(uint8_t), 0); + if (calc_hdrcsum != mhdr-checkSum) { + return -2; /* ext header csum not matched */ + } + return 0; +} + +void kwbimage_print_contents (struct kwb_header *hdr) { + bhr_t *mhdr = hdr-kwb_hdr; + char * bootdev = Unknown; + + if (mhdr-blockid == IBR_HDR_SPI_ID) + bootdev = spi; + if (mhdr-blockid == IBR_HDR_NAND_ID) + bootdev = nand; + if (mhdr-blockid == IBR_HDR_SATA_ID) + bootdev = sata; + + printf(Image Type: Kirkwood Boot from %s Image\n, bootdev); + printf(Data Size:); + genimg_print_size (mhdr-blocksize - sizeof(uint32_t)); + printf(Load Address: %08x\n, mhdr-destaddr); + printf(Entry Point: %08x\n, mhdr-execaddr); +} diff --git a/tools/mkimage.c b/tools/mkimage.c index ba71874..0d46bda 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -166,7 +166,7 @@ NXTARG: ; usage(); if (((argc != 1) (opt_type == IH_TYPE_KWBIMAGE)) - (xflag || lflag)) + (xflag)) usage(); if (!eflag) { @@ -231,6 +231,11 @@ NXTARG:; exit (EXIT_FAILURE); } + if (!(kwbimage_check_header ((struct kwb_header *)ptr))) { + kwbimage_print_contents ((struct kwb_header *)ptr); + exit (EXIT_SUCCESS); + } + if (fdt_check_header (ptr)) { /* old-style image */ image_verify_header ((char *)ptr, sbuf.st_size); -- 1.5.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH] Support for the Calao TNY-A9260 board
The Calao TNY-A9260 board is a board manufactured and sold by Calao Systems http://www.calao-systems.com. Its components are very similar to the AT91SAM9260EK board, so its configuration is based on the configuration of this board. There are however some differences: different clocks, no LCD, no ethernet. It also uses SPI EEPROM to store the environment. The SPI chip is a STM95080, and as it's used in a number of CALAO boards which should be supported soon, the corresponding spi_read and spi_write functions have been put in drivers/spi/eeprom_m95xxx.c --- MAINTAINERS |4 + MAKEALL |1 + Makefile | 12 +++ board/calao/tny_a9260/Makefile | 55 ++ board/calao/tny_a9260/config.mk |1 + board/calao/tny_a9260/spi.c | 49 + board/calao/tny_a9260/tny_a9260.c| 102 +++ cpu/arm926ejs/at91/at91sam9260_devices.c |2 +- drivers/spi/Makefile |1 + drivers/spi/eeprom_m95xxx.c | 114 + include/configs/tny_a9260.h | 158 ++ 11 files changed, 498 insertions(+), 1 deletions(-) create mode 100644 board/calao/tny_a9260/Makefile create mode 100644 board/calao/tny_a9260/config.mk create mode 100644 board/calao/tny_a9260/spi.c create mode 100644 board/calao/tny_a9260/tny_a9260.c create mode 100644 drivers/spi/eeprom_m95xxx.c create mode 100644 include/configs/tny_a9260.h diff --git a/MAINTAINERS b/MAINTAINERS index 575a7ec..1ba1921 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -624,6 +624,10 @@ Peter Pearse peter.pea...@arm.com versatile ARM926EJ-S versatile ARM926EJ-S +Albin Tonnerre albin.tonne...@free-electrons.com + + tny_a9260 ARM926EJS (AT91SAM9260 SoC) + Dave Peverley dpever...@mpc-data.co.uk omap730p2 ARM926EJS diff --git a/MAKEALL b/MAKEALL index 020ff73..59b65d2 100755 --- a/MAKEALL +++ b/MAKEALL @@ -599,6 +599,7 @@ LIST_at91= \ m501sk \ pm9261 \ pm9263 \ + tny_a9260 \ # diff --git a/Makefile b/Makefile index 25a6254..d05abd9 100644 --- a/Makefile +++ b/Makefile @@ -2807,6 +2807,18 @@ at91sam9g45ekes_config : unconfig pm9263_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91 +tny_a9260_nandflash_config \ +tny_a9260_eeprom_config \ +tny_a9260_config : unconfig + @if [ $(findstring _nandflash,$@) ] ; then \ + $(XECHO) #define CONFIG_ENV_IS_IN_NAND $(obj)include/config.h ; \ + $(XECHO) ... with environment variable in NAND FLASH ; \ + else \ + $(XECHO) #define CONFIG_ENV_IS_IN_EEPROM $(obj)include/config.h ; \ + $(XECHO) ... with environment variable in SPI EEPROM CS1 ; \ + fi; + @$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91 + ## ARM Integrator boards - see doc/README-integrator for more info. integratorap_config\ diff --git a/board/calao/tny_a9260/Makefile b/board/calao/tny_a9260/Makefile new file mode 100644 index 000..21f5ed1 --- /dev/null +++ b/board/calao/tny_a9260/Makefile @@ -0,0 +1,55 @@ +# +# (C) Copyright 2003-2008 +# Wolfgang Denk, DENX Software Engineering, w...@denx.de. +# +# (C) Copyright 2008 +# Stelian Pop stelian@leadtechdesign.com +# Lead Tech Design www.leadtechdesign.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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).a + +COBJS-y+= tny_a9260.o +COBJS-$(CONFIG_ATMEL_SPI) += spi.o + +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS-y)) +SOBJS := $(addprefix $(obj),$(SOBJS)) + +$(LIB):$(obj).depend $(OBJS) $(SOBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS) + +clean: + rm -f $(SOBJS) $(OBJS) + +distclean: clean + rm -f $(LIB) core *.bak
Re: [U-Boot] [PATCH] - save the server's mac address...
On Tue 21 Jul 2009 02:37, Ben Warren pondered: Can you please re-submit using git tools? From: Robin Getz rg...@blackfin.uclinux.org Linux's netconsole works much better when you can pass it the MAC address of the server. (otherwise it just uses broadcast, which everyone else on my network complains about :) This sets the env var serveraddr (to match ethaddr), so that you can pass it to linux with whatever bootargs you want to addnetconsole=set bootargs $(bootargs) netconso...@$(ipaddr)/eth0,@$(serverip)/$(serveraddr) Signed-of-by: Robin Getz rg...@blackfin.uclinux.org - diff --git a/README b/README index 4c74cb7..9071472 100644 --- a/README +++ b/README @@ -1184,6 +1184,11 @@ The following options need to be configured: Defines a default value for the IP address of a TFTP server to contact when using the tftboot command. + CONFIG_KEEP_SERVERADDR + + Keeps the server's MAC address, in the env 'serveraddr' + for passing to bootargs (like Linux's netconsole option) + - Multicast TFTP Mode: CONFIG_MCAST_TFTP diff --git a/net/net.c b/net/net.c index 7ce947d..641c37c 100644 --- a/net/net.c +++ b/net/net.c @@ -1287,6 +1287,15 @@ NetReceive(volatile uchar * inpkt, int len) /* are we waiting for a reply */ if (!NetArpWaitPacketIP || !NetArpWaitPacketMAC) break; + +#ifdef CONFIG_KEEP_SERVERADDR + if (NetServerIP == NetArpWaitPacketIP) { + char buf[20]; + sprintf(buf, %pM, arp-ar_data); + setenv(serveraddr, buf); + } +#endif + #ifdef ET_DEBUG printf(Got ARP REPLY, set server/gtwy eth addr (%pM)\n, arp-ar_data); ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH] 85xx: Report which bank of NOR flash we are booting from on FSL boards
On Jul 21, 2009, at 10:08 AM, Wolfgang Denk wrote: Dear Kumar Gala, In message 1248187378-5970-1-git-send-email- ga...@kernel.crashing.org you wrote: The p2020DS, MPC8536DS, MPC8572DS, MPC8544DS boards are capable of swizzling the upper address bits of the NOR flash we boot out of which creates the concept of virtual banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in bank 0. The PIXIS FPGA exposes registers on LBC which we can use to determine which bank we are booting out of (as well as setting which bank to boot out of). Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- * This is a merged version of previous patches that covers all the 85xx boards board/freescale/mpc8536ds/mpc8536ds.c | 18 -- board/freescale/mpc8544ds/mpc8544ds.c | 11 +-- board/freescale/mpc8572ds/mpc8572ds.c | 21 - board/freescale/p2020ds/p2020ds.c | 12 +++- 4 files changed, 56 insertions(+), 6 deletions(-) diff --git a/board/freescale/mpc8536ds/mpc8536ds.c b/board/ freescale/mpc8536ds/mpc8536ds.c index 28b27ee..91fb87b 100644 --- a/board/freescale/mpc8536ds/mpc8536ds.c +++ b/board/freescale/mpc8536ds/mpc8536ds.c @@ -60,10 +60,24 @@ int board_early_init_f (void) int checkboard (void) { -printf (Board: MPC8536DS, System ID: 0x%02x, -System Version: 0x%02x, FPGA Version: 0x%02x\n, +u8 vboot; + +puts(Board: MPC8536DS ); +#ifdef CONFIG_PHYS_64BIT +puts((36-bit addrmap) ); +#endif + +printf (Sys ID: 0x%02x, +Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), in8(PIXIS_BASE + PIXIS_PVER)); + +vboot = in8(PIXIS_BASE + 0x16); +if ((vboot 7) 0x1) +puts (Promjet\n); +else +printf (vBank: %d\n, ((vboot 5) 0x3)); + return 0; } So how many boards are copying this mostly identical code? How about factoring out the big common parts? Agreed, but its not something I'm trying to accomplish in this go around. The PIXIS code is just slightly different enough on these boards that its needs a good scrub to refactor and clean it up. - k ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2] 86xx: Report which bank of NOR flash we are booting from on MPC8641HPCN
The MPC8641HPCN board is capable of swizzling the upper address bit of the NOR flash we boot out of which creates the concept of virtual banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in bank 0. The PIXIS FPGA exposes registers on LBC which we can use to determine which bank we are booting out of (as well as setting which bank to boot out of). Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- * Moved from in8 - in_8 * used PIXIS_VBOOT instead of magic 0x16 * simplified if() test - k board/freescale/mpc8641hpcn/mpc8641hpcn.c | 18 ++ 1 files changed, 14 insertions(+), 4 deletions(-) diff --git a/board/freescale/mpc8641hpcn/mpc8641hpcn.c b/board/freescale/mpc8641hpcn/mpc8641hpcn.c index 7422e6b..ab7a04c 100644 --- a/board/freescale/mpc8641hpcn/mpc8641hpcn.c +++ b/board/freescale/mpc8641hpcn/mpc8641hpcn.c @@ -42,10 +42,20 @@ int board_early_init_f(void) int checkboard(void) { - printf (Board: MPC8641HPCN, System ID: 0x%02x, - System Version: 0x%02x, FPGA Version: 0x%02x\n, - in8(PIXIS_BASE + PIXIS_ID), in8(PIXIS_BASE + PIXIS_VER), - in8(PIXIS_BASE + PIXIS_PVER)); + u8 vboot; + u8 *pixis_base = (u8 *)PIXIS_BASE; + + printf (Board: MPC8641HPCN, Sys ID: 0x%02x, + Sys Ver: 0x%02x, FPGA Ver: 0x%02x, , + in_8(pixis_base + PIXIS_ID), in_8(pixis_base + PIXIS_VER), + in_8(pixis_base + PIXIS_PVER)); + + vboot = in_8(pixis_base + PIXIS_VBOOT); + if (vboot 0x80) + printf (vBank: %d\n, ((vboot 6) 0x1)); + else + puts (Promjet\n); + #ifdef CONFIG_PHYS_64BIT printf ( 36-bit physical address map\n); #endif -- 1.6.0.6 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH 3/4] tools: mkimage: kwbimage list command support
On Tuesday 21 July 2009 23:25:50 Prafulla Wadaskar wrote: Signed-off-by: Prafulla Wadaskar prafu...@marvell.com Just some quick nitpicking comment below. --- common/image.c |4 ++-- tools/kwbimage.c | 41 + tools/mkimage.c |7 ++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/common/image.c b/common/image.c index 845006f..e3ad3e5 100644 --- a/common/image.c +++ b/common/image.c @@ -159,7 +159,7 @@ static table_entry_t uimage_comp[] = { uint32_t crc32 (uint32_t, const unsigned char *, uint); uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint); -static void genimg_print_size (uint32_t size); +void genimg_print_size (uint32_t size); #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC) static void genimg_print_time (time_t timestamp); #endif @@ -473,7 +473,7 @@ void memmove_wd (void *to, void *from, size_t len, ulong chunksz) } #endif /* !USE_HOSTCC */ -static void genimg_print_size (uint32_t size) +void genimg_print_size (uint32_t size) { #ifndef USE_HOSTCC printf (%d Bytes = , size); diff --git a/tools/kwbimage.c b/tools/kwbimage.c index b1ad37a..13bd57f 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -33,6 +33,8 @@ #include unistd.h #include kwbimage.h +extern void genimg_print_size (uint32_t size); + static struct kwb_header kwbimage_header; static int datacmd_cnt = 0; @@ -262,3 +264,42 @@ void kwbimage_set_header (struct kwb_header *hdr, struct stat *sbuf, exthdr-checkSum = kwbimage_checksum8((void *)exthdr, sizeof(extbhr_t), 0); } + +/* -l support functions */ +int kwbimage_check_header (struct kwb_header *hdr) +{ + bhr_t *mhdr = hdr-kwb_hdr; + extbhr_t *exthdr = hdr-kwb_exthdr; + uint8_t calc_hdrcsum; + uint8_t calc_exthdrcsum; + + calc_hdrcsum = kwbimage_checksum8((void *)mhdr, + sizeof(bhr_t) - sizeof(uint8_t), 0); + if (calc_hdrcsum != mhdr-checkSum) { + return -1; /* main header csum not matched */ + } No braces needed on single-line statements. + calc_exthdrcsum = kwbimage_checksum8((void *)exthdr, + sizeof(extbhr_t) - sizeof(uint8_t), 0); + if (calc_hdrcsum != mhdr-checkSum) { + return -2; /* ext header csum not matched */ Perhaps use some defines for those errors (-1, -2 etc). + } Again, no braces here. + return 0; +} + +void kwbimage_print_contents (struct kwb_header *hdr) { + bhr_t *mhdr = hdr-kwb_hdr; + char * bootdev = Unknown; + + if (mhdr-blockid == IBR_HDR_SPI_ID) + bootdev = spi; + if (mhdr-blockid == IBR_HDR_NAND_ID) + bootdev = nand; + if (mhdr-blockid == IBR_HDR_SATA_ID) + bootdev = sata; + + printf(Image Type: Kirkwood Boot from %s Image\n, bootdev); + printf(Data Size:); + genimg_print_size (mhdr-blocksize - sizeof(uint32_t)); + printf(Load Address: %08x\n, mhdr-destaddr); + printf(Entry Point: %08x\n, mhdr-execaddr); You are mixing coding styles here. func() vs. func () (space before (). Please use only one style per file. Thanks. Best regards, 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: off...@denx.de = ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 4/4] Kirkwood: Sheevaplug: kwimage configuration
Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- Change log: v2: updated as per review feedback for v1 board/Marvell/sheevaplug/config.mk|3 + board/Marvell/sheevaplug/kwbimage.cfg | 162 + 2 files changed, 165 insertions(+), 0 deletions(-) create mode 100644 board/Marvell/sheevaplug/kwbimage.cfg diff --git a/board/Marvell/sheevaplug/config.mk b/board/Marvell/sheevaplug/config.mk index a4ea769..2bd9f79 100644 --- a/board/Marvell/sheevaplug/config.mk +++ b/board/Marvell/sheevaplug/config.mk @@ -23,3 +23,6 @@ # TEXT_BASE = 0x0060 + +# Kirkwood Boot Image configuration file +KWD_CONFIG = $(SRCTREE)/board/$(BOARDDIR)/kwbimage.cfg diff --git a/board/Marvell/sheevaplug/kwbimage.cfg b/board/Marvell/sheevaplug/kwbimage.cfg new file mode 100644 index 000..de12e74 --- /dev/null +++ b/board/Marvell/sheevaplug/kwbimage.cfg @@ -0,0 +1,162 @@ +# +# (C) Copyright 2009 +# Marvell Semiconductor www.marvell.com +# Written-by: Prafulla Wadaskar prafu...@marvell.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., 51 Franklin Street, Fifth Floor, Boston, +# MA 02110-1301 USA +# +# Refer docs/README.kwimage for more details about how-to configure +# and create kirkwood boot image +# + +# Boot Media configurations +BOOT_FROM nand +NAND_ECC_MODE default +NAND_PAGE_SIZE 0x0800 + +# SOC registers configuration using bootrom header extension +# Maximum KWBIMAGE_MAX_CONFIG configurations allowed + +# Configure RGMII-0 interface pad voltage to 1.8V +0xFFD100e0 0x1b1b1b9b + +#Dram initalization for SINGLE x16 CL=5 @ 400MHz +0xFFD01400 0x43000c30 # DDR Configuration register +# bit13-0: 0xc30 (3120 DDR2 clks refresh rate) +# bit23-14: zero +# bit24: 1= enable exit self refresh mode on DDR access +# bit25: 1 required +# bit29-26: zero +# bit31-30: 01 + +0xFFD01404 0x37543000 # DDR Controller Control Low +# bit 4:0=addr/cmd in smame cycle +# bit 5:0=clk is driven during self refresh, we don't care for APX +# bit 6:0=use recommended falling edge of clk for addr/cmd +# bit14:0=input buffer always powered up +# bit18:1=cpu lock transaction enabled +# bit23-20: 5=recommended value for CL=5 and STARTBURST_DEL disabled bit31=0 +# bit27-24: 7= CL+2, STARTBURST sample stages, for freqs 400MHz, unbuffered DIMM +# bit30-28: 3 required +# bit31:0=no additional STARTBURST delay + +0xFFD01408 0x22125451 # DDR Timing (Low) (active cycles value +1) +# bit3-0: TRAS lsbs +# bit7-4: TRCD +# bit11- 8: TRP +# bit15-12: TWR +# bit19-16: TWTR +# bit20:TRAS msb +# bit23-21: 0x0 +# bit27-24: TRRD +# bit31-28: TRTP + +0xFFD0140C 0x0a33 # DDR Timing (High) +# bit6-0: TRFC +# bit8-7: TR2R +# bit10-9: TR2W +# bit12-11: TW2W +# bit31-13: zero required + +0xFFD01410 0x0099 # DDR Address Control +# bit1-0: 01, Cs0width=x16 +# bit3-2: 10, Cs0size=512Mb +# bit5-4: 01, Cs1width=x16 +# bit7-6: 10, Cs1size=512Mb +# bit9-8: 00, Cs2width=nonexistent +# bit11-10: 00, Cs2size =nonexistent +# bit13-12: 00, Cs3width=nonexistent +# bit15-14: 00, Cs3size =nonexistent +# bit16:0, Cs0AddrSel +# bit17:0, Cs1AddrSel +# bit18:0, Cs2AddrSel +# bit19:0, Cs3AddrSel +# bit31-20: 0 required + +0xFFD01414 0x # DDR Open Pages Control +# bit0:0, OpenPage enabled +# bit31-1: 0 required + +0xFFD01418 0x # DDR Operation +# bit3-0: 0x0, DDR cmd +# bit31-4: 0 required + +0xFFD0141C 0x0C52 # DDR Mode +# bit2-0: 2, BurstLen=2 required +# bit3: 0, BurstType=0 required +# bit6-4: 4, CL=5 +# bit7: 0, TestMode=0 normal +# bit8: 0, DLL reset=0 normal +# bit11-9: 6, auto-precharge write recovery +# bit12:0, PD must be zero +# bit31-13: 0 required + +0xFFD01420 0x0040 # DDR Extended Mode +# bit0:0, DDR DLL enabled +# bit1:0, DDR drive strenght normal +# bit2:0, DDR ODT control lsd (disabled) +# bit5-3: 000, required +# bit6:1, DDR ODT control msb, (disabled) +# bit9-7: 000, required +# bit10: 0, differential DQS enabled +# bit11: 0, required +# bit12: 0, DDR output buffer enabled +# bit31-13: 0 required + +0xFFD01424 0xF17F # DDR Controller Control High +# bit2-0: 111, required +# bit3 : 1 , MBUS Burst Chop disabled +# bit6-4: 111, required +# bit7 : 0 +#
[U-Boot] [PATCH v2 2/4] tools: mkimage (type=kwbimage) kirkwood boot image support
For more details refer docs/README.kwbimage Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- Change log: v2: strtok_r() used for simple parser algorithm updated as per feedback for v1 all line checked to be below 78 :-) Makefile|5 + common/image.c |1 + doc/README.kwbimage | 93 ++ include/image.h |1 + tools/Makefile |1 + tools/kwbimage.c| 264 +++ tools/kwbimage.h| 104 tools/mkimage.c | 26 +- 8 files changed, 494 insertions(+), 1 deletions(-) create mode 100644 doc/README.kwbimage create mode 100644 tools/kwbimage.c create mode 100644 tools/kwbimage.h diff --git a/Makefile b/Makefile index 55fc2a3..ebe00dc 100644 --- a/Makefile +++ b/Makefile @@ -339,6 +339,10 @@ $(obj)u-boot.img: $(obj)u-boot.bin sed -e 's/[ ]*$$/ for $(BOARD) board/') \ -d $ $@ +$(obj)u-boot.kwb: $(obj)u-boot.bin + $(obj)tools/mkimage -n $(KWD_CONFIG) -T kwbimage \ + -a $(TEXT_BASE) -e $(TEXT_BASE) -d $ $@ + $(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)tools/ubsha1 $(obj)u-boot.bin @@ -3638,6 +3642,7 @@ clobber: clean @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \ $(obj)cscope.* $(obj)*.*~ @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL) + @rm -f $(obj)u-boot.kwb @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes} @rm -f $(obj)cpu/mpc824x/bedbug_603e.c @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm diff --git a/common/image.c b/common/image.c index e22c974..845006f 100644 --- a/common/image.c +++ b/common/image.c @@ -145,6 +145,7 @@ static table_entry_t uimage_type[] = { { IH_TYPE_SCRIPT, script, Script, }, { IH_TYPE_STANDALONE, standalone, Standalone Program, }, { IH_TYPE_FLATDT, flat_dt,Flat Device Tree, }, + { IH_TYPE_KWBIMAGE, kwbimage, Kirkwood Boot Image,}, { -1, , , }, }; diff --git a/doc/README.kwbimage b/doc/README.kwbimage new file mode 100644 index 000..b8a9b6b --- /dev/null +++ b/doc/README.kwbimage @@ -0,0 +1,93 @@ +- +Kirkwood Boot Image generation using mkimage +- + +This document describes the U-Boot feature as it +is implemented for the Kirkwood family of SoCs. + +The Kirkwood SoC's can boot directly from NAND FLASH, +SPI FLASH, SATA etc. using its internal bootRom support. + +for more details refer section 24.2 of Kirkwood functional specifications. +ref: www.marvell.com/products/embedded.../kirkwood/index.jsp + +Commad syntax: +-- +./tools/mkimage -l kwboot_file + to list the kwb image file details + +./tools/mkimage -n board specific configuration file \ +-T kwbimage -a start address -e execution address \ + -d input_raw_binary output_kwboot_file + +for ex. +./tools/mkimage -n ./board/Marvell/openrd_base/kwbimage.cfg \ +-T kwbimage -a 0x0060 -e 0x0060 \ + -d u-boot.bin u-boot.kwb + +kwimage support available with mkimage utility will generate kirkwood boot +image that can be flashed on the board NAND/SPI flash + +Board specific configuration file specifications: + +1. This file must present in the $(BOARDDIR) and the name should be + kwbimage.cfg (since this is used in Makefile) +2. This file can have empty lines and lines starting with # as first + character to put comments +3. This file can have configuration command lines as mentioned below, + any other information in this file is treated as invalid. + +Configuration command line syntax: +- +1. Each command line is must have two strings, first one command or address + and second one data string +2. Following are the valid command strings and associated data strings:- + Command string data string + -- --- + BOOT_FROM nand/spi/sata + NAND_ECC_MODE default/rs/hamming/disabled + NAND_PAGE_SIZE any uint16_t hex value + SATA_PIO_MODE any uint32_t hex value + DDR_INIT_DELAY any uint32_t hex value + uint32_t reg addr uint32_t vlaue for it, + you can have maximum 55 such register programming commands + +3. All commands are optional to program + +Typical example of kwimage.cfg file: +--- + +# Boot Media configurations +BOOT_FROM nand +NAND_ECC_MODE default +NAND_PAGE_SIZE 0x0800 + +# Configure RGMII-0 interface pad voltage to 1.8V +0xFFD100e0 0x1b1b1b9b +# DRAM Configuration
[U-Boot] [PATCH 3/4] tools: mkimage: kwbimage list command support
Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- common/image.c |4 ++-- tools/kwbimage.c | 41 + tools/mkimage.c |7 ++- 3 files changed, 49 insertions(+), 3 deletions(-) diff --git a/common/image.c b/common/image.c index 845006f..e3ad3e5 100644 --- a/common/image.c +++ b/common/image.c @@ -159,7 +159,7 @@ static table_entry_t uimage_comp[] = { uint32_t crc32 (uint32_t, const unsigned char *, uint); uint32_t crc32_wd (uint32_t, const unsigned char *, uint, uint); -static void genimg_print_size (uint32_t size); +void genimg_print_size (uint32_t size); #if defined(CONFIG_TIMESTAMP) || defined(CONFIG_CMD_DATE) || defined(USE_HOSTCC) static void genimg_print_time (time_t timestamp); #endif @@ -473,7 +473,7 @@ void memmove_wd (void *to, void *from, size_t len, ulong chunksz) } #endif /* !USE_HOSTCC */ -static void genimg_print_size (uint32_t size) +void genimg_print_size (uint32_t size) { #ifndef USE_HOSTCC printf (%d Bytes = , size); diff --git a/tools/kwbimage.c b/tools/kwbimage.c index b1ad37a..13bd57f 100644 --- a/tools/kwbimage.c +++ b/tools/kwbimage.c @@ -33,6 +33,8 @@ #include unistd.h #include kwbimage.h +extern void genimg_print_size (uint32_t size); + static struct kwb_header kwbimage_header; static int datacmd_cnt = 0; @@ -262,3 +264,42 @@ void kwbimage_set_header (struct kwb_header *hdr, struct stat *sbuf, exthdr-checkSum = kwbimage_checksum8((void *)exthdr, sizeof(extbhr_t), 0); } + +/* -l support functions */ +int kwbimage_check_header (struct kwb_header *hdr) +{ + bhr_t *mhdr = hdr-kwb_hdr; + extbhr_t *exthdr = hdr-kwb_exthdr; + uint8_t calc_hdrcsum; + uint8_t calc_exthdrcsum; + + calc_hdrcsum = kwbimage_checksum8((void *)mhdr, + sizeof(bhr_t) - sizeof(uint8_t), 0); + if (calc_hdrcsum != mhdr-checkSum) { + return -1; /* main header csum not matched */ + } + calc_exthdrcsum = kwbimage_checksum8((void *)exthdr, + sizeof(extbhr_t) - sizeof(uint8_t), 0); + if (calc_hdrcsum != mhdr-checkSum) { + return -2; /* ext header csum not matched */ + } + return 0; +} + +void kwbimage_print_contents (struct kwb_header *hdr) { + bhr_t *mhdr = hdr-kwb_hdr; + char * bootdev = Unknown; + + if (mhdr-blockid == IBR_HDR_SPI_ID) + bootdev = spi; + if (mhdr-blockid == IBR_HDR_NAND_ID) + bootdev = nand; + if (mhdr-blockid == IBR_HDR_SATA_ID) + bootdev = sata; + + printf(Image Type: Kirkwood Boot from %s Image\n, bootdev); + printf(Data Size:); + genimg_print_size (mhdr-blocksize - sizeof(uint32_t)); + printf(Load Address: %08x\n, mhdr-destaddr); + printf(Entry Point: %08x\n, mhdr-execaddr); +} diff --git a/tools/mkimage.c b/tools/mkimage.c index ba71874..0d46bda 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -166,7 +166,7 @@ NXTARG: ; usage(); if (((argc != 1) (opt_type == IH_TYPE_KWBIMAGE)) - (xflag || lflag)) + (xflag)) usage(); if (!eflag) { @@ -231,6 +231,11 @@ NXTARG:; exit (EXIT_FAILURE); } + if (!(kwbimage_check_header ((struct kwb_header *)ptr))) { + kwbimage_print_contents ((struct kwb_header *)ptr); + exit (EXIT_SUCCESS); + } + if (fdt_check_header (ptr)) { /* old-style image */ image_verify_header ((char *)ptr, sbuf.st_size); -- 1.5.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/4] tools: mkimage: hdr_size used to facilitate customized support
hdr_size variable is initialized at the begining of image creation algorithm instead of reading it each time. This facilitate to use the common code for other image type implementations for ex. kwbimage Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- hdr_size declaration moved at the top tools/mkimage.c | 18 -- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/mkimage.c b/tools/mkimage.c index 967fe9a..40363a9 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -66,6 +66,7 @@ main (int argc, char **argv) struct stat sbuf; unsigned char *ptr; char *name = ; + int hdr_size; cmdname = *argv; @@ -250,9 +251,9 @@ NXTARG: ; * * write dummy header, to be fixed later */ - memset (hdr, 0, image_get_header_size ()); - - if (write(ifd, hdr, image_get_header_size ()) != image_get_header_size ()) { + hdr_size = image_get_header_size (); + memset (hdr, 0, hdr_size); + if (write(ifd, hdr, hdr_size) != hdr_size) { fprintf (stderr, %s: Write error on %s: %s\n, cmdname, imagefile, strerror(errno)); exit (EXIT_FAILURE); @@ -339,14 +340,12 @@ NXTARG: ; hdr = (image_header_t *)ptr; checksum = crc32 (0, - (const char *)(ptr + image_get_header_size ()), - sbuf.st_size - image_get_header_size () -); - + (const char *)(ptr + hdr_size), + sbuf.st_size - hdr_size); /* Build new header */ image_set_magic (hdr, IH_MAGIC); image_set_time (hdr, sbuf.st_mtime); - image_set_size (hdr, sbuf.st_size - image_get_header_size ()); + image_set_size (hdr, sbuf.st_size - hdr_size); image_set_load (hdr, addr); image_set_ep (hdr, ep); image_set_dcrc (hdr, checksum); @@ -354,10 +353,9 @@ NXTARG:; image_set_arch (hdr, opt_arch); image_set_type (hdr, opt_type); image_set_comp (hdr, opt_comp); - image_set_name (hdr, name); - checksum = crc32 (0, (const char *)hdr, image_get_header_size ()); + checksum = crc32 (0, (const char *)hdr, hdr_size); image_set_hcrc (hdr, checksum); -- 1.5.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/4] tools: mkimage: hdr_size used to facilitate customized support
hdr_size variable is initialized at the begining of image creation algorithm instead of reading it each time. This facilitate to use the common code for other image type implementations for ex. kwbimage Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- hdr_size declaration moved at the top tools/mkimage.c | 18 -- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/mkimage.c b/tools/mkimage.c index 967fe9a..40363a9 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -66,6 +66,7 @@ main (int argc, char **argv) struct stat sbuf; unsigned char *ptr; char *name = ; + int hdr_size; cmdname = *argv; @@ -250,9 +251,9 @@ NXTARG: ; * * write dummy header, to be fixed later */ - memset (hdr, 0, image_get_header_size ()); - - if (write(ifd, hdr, image_get_header_size ()) != image_get_header_size ()) { + hdr_size = image_get_header_size (); + memset (hdr, 0, hdr_size); + if (write(ifd, hdr, hdr_size) != hdr_size) { fprintf (stderr, %s: Write error on %s: %s\n, cmdname, imagefile, strerror(errno)); exit (EXIT_FAILURE); @@ -339,14 +340,12 @@ NXTARG: ; hdr = (image_header_t *)ptr; checksum = crc32 (0, - (const char *)(ptr + image_get_header_size ()), - sbuf.st_size - image_get_header_size () -); - + (const char *)(ptr + hdr_size), + sbuf.st_size - hdr_size); /* Build new header */ image_set_magic (hdr, IH_MAGIC); image_set_time (hdr, sbuf.st_mtime); - image_set_size (hdr, sbuf.st_size - image_get_header_size ()); + image_set_size (hdr, sbuf.st_size - hdr_size); image_set_load (hdr, addr); image_set_ep (hdr, ep); image_set_dcrc (hdr, checksum); @@ -354,10 +353,9 @@ NXTARG:; image_set_arch (hdr, opt_arch); image_set_type (hdr, opt_type); image_set_comp (hdr, opt_comp); - image_set_name (hdr, name); - checksum = crc32 (0, (const char *)hdr, image_get_header_size ()); + checksum = crc32 (0, (const char *)hdr, hdr_size); image_set_hcrc (hdr, checksum); -- 1.5.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/4] tools: mkimage: hdr_size used to facilitate customized support
hdr_size variable is initialized at the begining of image creation algorithm instead of reading it each time. This facilitate to use the common code for other image type implementations for ex. kwbimage Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- hdr_size declaration moved at the top tools/mkimage.c | 18 -- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/mkimage.c b/tools/mkimage.c index 967fe9a..40363a9 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -66,6 +66,7 @@ main (int argc, char **argv) struct stat sbuf; unsigned char *ptr; char *name = ; + int hdr_size; cmdname = *argv; @@ -250,9 +251,9 @@ NXTARG: ; * * write dummy header, to be fixed later */ - memset (hdr, 0, image_get_header_size ()); - - if (write(ifd, hdr, image_get_header_size ()) != image_get_header_size ()) { + hdr_size = image_get_header_size (); + memset (hdr, 0, hdr_size); + if (write(ifd, hdr, hdr_size) != hdr_size) { fprintf (stderr, %s: Write error on %s: %s\n, cmdname, imagefile, strerror(errno)); exit (EXIT_FAILURE); @@ -339,14 +340,12 @@ NXTARG: ; hdr = (image_header_t *)ptr; checksum = crc32 (0, - (const char *)(ptr + image_get_header_size ()), - sbuf.st_size - image_get_header_size () -); - + (const char *)(ptr + hdr_size), + sbuf.st_size - hdr_size); /* Build new header */ image_set_magic (hdr, IH_MAGIC); image_set_time (hdr, sbuf.st_mtime); - image_set_size (hdr, sbuf.st_size - image_get_header_size ()); + image_set_size (hdr, sbuf.st_size - hdr_size); image_set_load (hdr, addr); image_set_ep (hdr, ep); image_set_dcrc (hdr, checksum); @@ -354,10 +353,9 @@ NXTARG:; image_set_arch (hdr, opt_arch); image_set_type (hdr, opt_type); image_set_comp (hdr, opt_comp); - image_set_name (hdr, name); - checksum = crc32 (0, (const char *)hdr, image_get_header_size ()); + checksum = crc32 (0, (const char *)hdr, hdr_size); image_set_hcrc (hdr, checksum); -- 1.5.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 1/4] tools: mkimage: hdr_size used to facilitate customized support
hdr_size variable is initialized at the begining of image creation algorithm instead of reading it each time. This facilitate to use the common code for other image type implementations for ex. kwbimage Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- hdr_size declaration moved at the top tools/mkimage.c | 18 -- 1 files changed, 8 insertions(+), 10 deletions(-) diff --git a/tools/mkimage.c b/tools/mkimage.c index 967fe9a..40363a9 100644 --- a/tools/mkimage.c +++ b/tools/mkimage.c @@ -66,6 +66,7 @@ main (int argc, char **argv) struct stat sbuf; unsigned char *ptr; char *name = ; + int hdr_size; cmdname = *argv; @@ -250,9 +251,9 @@ NXTARG: ; * * write dummy header, to be fixed later */ - memset (hdr, 0, image_get_header_size ()); - - if (write(ifd, hdr, image_get_header_size ()) != image_get_header_size ()) { + hdr_size = image_get_header_size (); + memset (hdr, 0, hdr_size); + if (write(ifd, hdr, hdr_size) != hdr_size) { fprintf (stderr, %s: Write error on %s: %s\n, cmdname, imagefile, strerror(errno)); exit (EXIT_FAILURE); @@ -339,14 +340,12 @@ NXTARG: ; hdr = (image_header_t *)ptr; checksum = crc32 (0, - (const char *)(ptr + image_get_header_size ()), - sbuf.st_size - image_get_header_size () -); - + (const char *)(ptr + hdr_size), + sbuf.st_size - hdr_size); /* Build new header */ image_set_magic (hdr, IH_MAGIC); image_set_time (hdr, sbuf.st_mtime); - image_set_size (hdr, sbuf.st_size - image_get_header_size ()); + image_set_size (hdr, sbuf.st_size - hdr_size); image_set_load (hdr, addr); image_set_ep (hdr, ep); image_set_dcrc (hdr, checksum); @@ -354,10 +353,9 @@ NXTARG:; image_set_arch (hdr, opt_arch); image_set_type (hdr, opt_type); image_set_comp (hdr, opt_comp); - image_set_name (hdr, name); - checksum = crc32 (0, (const char *)hdr, image_get_header_size ()); + checksum = crc32 (0, (const char *)hdr, hdr_size); image_set_hcrc (hdr, checksum); -- 1.5.3.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH v2 2/4] tools: mkimage (type=kwbimage) kirkwood boot image support
For more details refer docs/README.kwbimage Signed-off-by: Prafulla Wadaskar prafu...@marvell.com --- Change log: v2: strtok_r() used for simple parser algorithm updated as per feedback for v1 all line checked to be below 78 :-) Makefile|5 + common/image.c |1 + doc/README.kwbimage | 93 ++ include/image.h |1 + tools/Makefile |1 + tools/kwbimage.c| 264 +++ tools/kwbimage.h| 104 tools/mkimage.c | 26 +- 8 files changed, 494 insertions(+), 1 deletions(-) create mode 100644 doc/README.kwbimage create mode 100644 tools/kwbimage.c create mode 100644 tools/kwbimage.h diff --git a/Makefile b/Makefile index 55fc2a3..ebe00dc 100644 --- a/Makefile +++ b/Makefile @@ -339,6 +339,10 @@ $(obj)u-boot.img: $(obj)u-boot.bin sed -e 's/[ ]*$$/ for $(BOARD) board/') \ -d $ $@ +$(obj)u-boot.kwb: $(obj)u-boot.bin + $(obj)tools/mkimage -n $(KWD_CONFIG) -T kwbimage \ + -a $(TEXT_BASE) -e $(TEXT_BASE) -d $ $@ + $(obj)u-boot.sha1: $(obj)u-boot.bin $(obj)tools/ubsha1 $(obj)u-boot.bin @@ -3638,6 +3642,7 @@ clobber: clean @rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \ $(obj)cscope.* $(obj)*.*~ @rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL) + @rm -f $(obj)u-boot.kwb @rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes} @rm -f $(obj)cpu/mpc824x/bedbug_603e.c @rm -f $(obj)include/asm/proc $(obj)include/asm/arch $(obj)include/asm diff --git a/common/image.c b/common/image.c index e22c974..845006f 100644 --- a/common/image.c +++ b/common/image.c @@ -145,6 +145,7 @@ static table_entry_t uimage_type[] = { { IH_TYPE_SCRIPT, script, Script, }, { IH_TYPE_STANDALONE, standalone, Standalone Program, }, { IH_TYPE_FLATDT, flat_dt,Flat Device Tree, }, + { IH_TYPE_KWBIMAGE, kwbimage, Kirkwood Boot Image,}, { -1, , , }, }; diff --git a/doc/README.kwbimage b/doc/README.kwbimage new file mode 100644 index 000..b8a9b6b --- /dev/null +++ b/doc/README.kwbimage @@ -0,0 +1,93 @@ +- +Kirkwood Boot Image generation using mkimage +- + +This document describes the U-Boot feature as it +is implemented for the Kirkwood family of SoCs. + +The Kirkwood SoC's can boot directly from NAND FLASH, +SPI FLASH, SATA etc. using its internal bootRom support. + +for more details refer section 24.2 of Kirkwood functional specifications. +ref: www.marvell.com/products/embedded.../kirkwood/index.jsp + +Commad syntax: +-- +./tools/mkimage -l kwboot_file + to list the kwb image file details + +./tools/mkimage -n board specific configuration file \ +-T kwbimage -a start address -e execution address \ + -d input_raw_binary output_kwboot_file + +for ex. +./tools/mkimage -n ./board/Marvell/openrd_base/kwbimage.cfg \ +-T kwbimage -a 0x0060 -e 0x0060 \ + -d u-boot.bin u-boot.kwb + +kwimage support available with mkimage utility will generate kirkwood boot +image that can be flashed on the board NAND/SPI flash + +Board specific configuration file specifications: + +1. This file must present in the $(BOARDDIR) and the name should be + kwbimage.cfg (since this is used in Makefile) +2. This file can have empty lines and lines starting with # as first + character to put comments +3. This file can have configuration command lines as mentioned below, + any other information in this file is treated as invalid. + +Configuration command line syntax: +- +1. Each command line is must have two strings, first one command or address + and second one data string +2. Following are the valid command strings and associated data strings:- + Command string data string + -- --- + BOOT_FROM nand/spi/sata + NAND_ECC_MODE default/rs/hamming/disabled + NAND_PAGE_SIZE any uint16_t hex value + SATA_PIO_MODE any uint32_t hex value + DDR_INIT_DELAY any uint32_t hex value + uint32_t reg addr uint32_t vlaue for it, + you can have maximum 55 such register programming commands + +3. All commands are optional to program + +Typical example of kwimage.cfg file: +--- + +# Boot Media configurations +BOOT_FROM nand +NAND_ECC_MODE default +NAND_PAGE_SIZE 0x0800 + +# Configure RGMII-0 interface pad voltage to 1.8V +0xFFD100e0 0x1b1b1b9b +# DRAM Configuration
Re: [U-Boot] [PATCH] Support for the Calao TNY-A9260 board
Dear Albin Tonnerre, In message 1248191599-23258-1-git-send-email-albin.tonne...@free-electrons.com you wrote: The Calao TNY-A9260 board is a board manufactured and sold by Calao Systems http://www.calao-systems.com. Its components are very similar to the AT91SAM9260EK board, so its configuration is based on the configuration of this board. There are however some differences: different clocks, no LCD, no ethernet. It also uses SPI EEPROM to store the environment. The SPI chip is a STM95080, and as it's used in a number of CALAO boards which should be supported soon, the corresponding spi_read and spi_write functions have been put in drivers/spi/eeprom_m95xxx.c diff --git a/MAINTAINERS b/MAINTAINERS index 575a7ec..1ba1921 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -624,6 +624,10 @@ Peter Pearse peter.pea...@arm.com versatile ARM926EJ-S versatile ARM926EJ-S +Albin Tonnerre albin.tonne...@free-electrons.com + + tny_a9260 ARM926EJS (AT91SAM9260 SoC) + Dave Peverley dpever...@mpc-data.co.uk omap730p2 ARM926EJS Please keep list of names alphabetically sorted. diff --git a/MAKEALL b/MAKEALL index 020ff73..59b65d2 100755 --- a/MAKEALL +++ b/MAKEALL @@ -599,6 +599,7 @@ LIST_at91= \ m501sk \ pm9261 \ pm9263 \ + tny_a9260 \ # diff --git a/Makefile b/Makefile index 25a6254..d05abd9 100644 --- a/Makefile +++ b/Makefile @@ -2807,6 +2807,18 @@ at91sam9g45ekes_config : unconfig pm9263_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs pm9263 ronetix at91 +tny_a9260_nandflash_config \ +tny_a9260_eeprom_config \ +tny_a9260_config : unconfig + @if [ $(findstring _nandflash,$@) ] ; then \ + $(XECHO) #define CONFIG_ENV_IS_IN_NAND $(obj)include/config.h ; \ + $(XECHO) ... with environment variable in NAND FLASH ; \ + else \ + $(XECHO) #define CONFIG_ENV_IS_IN_EEPROM $(obj)include/config.h ; \ + $(XECHO) ... with environment variable in SPI EEPROM CS1 ; \ + fi; + @$(MKCONFIG) -a tny_a9260 arm arm926ejs tny_a9260 calao at91 Do we need such verbosity? And is there really only a single environment variable as the message claims? ... +int dram_init(void) +{ + gd-bd-bi_dram[0].start = PHYS_SDRAM; + gd-bd-bi_dram[0].size = get_ram_size(PHYS_SDRAM, PHYS_SDRAM_SIZE); + return 0; Hm... no error checking here? ... diff --git a/include/configs/tny_a9260.h b/include/configs/tny_a9260.h new file mode 100644 index 000..1dcbb97 --- /dev/null +++ b/include/configs/tny_a9260.h ... +#define ROUND(A, B) (((A) + (B)) ~((B) - 1)) Please do not redefine. Don't you get a warning message at least? 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 Documentation is the castor oil of programming. Managers know it must be good because the programmers hate it so much. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] [PATCH v2] 86xx: Report which bank of NOR flash we are booting from on MPC8641HPCN
Dear Kumar Gala, In message 1248193876-15362-1-git-send-email-ga...@kernel.crashing.org you wrote: The MPC8641HPCN board is capable of swizzling the upper address bit of the NOR flash we boot out of which creates the concept of virtual banks. This is useful in that we can flash a test of image of u-boot and reset to one of the virtual banks while still maintaining a working image in bank 0. The PIXIS FPGA exposes registers on LBC which we can use to determine which bank we are booting out of (as well as setting which bank to boot out of). Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- * Moved from in8 - in_8 * used PIXIS_VBOOT instead of magic 0x16 ... + if (vboot 0x80) + printf (vBank: %d\n, ((vboot 6) 0x1)); Any reasons for not using some named constants instead of the magix values 0x80 and 0x40 ? 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 No matter where you go, there you are... - Buckaroo Banzai ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] http client?
Sorry - first time I sent this -- I forgot to cc the list... On Tue 21 Jul 2009 12:37, Robin Getz pondered: redboot supports (and has since 2002) a mini-http client: This is just a transfer data via the network using HTTP protocol, no better or worse than tftp. (no https, no proxy, no other protocols). http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/ecos/packages/redboot/current/src/net/http_client.c?rev=1.11content-type=text/x-cvsweb-markupcvsroot=ecos I know there have been discussions about adding wget to U-Boot, which I agree is not something that is worthwhile to do. http://lists.denx.de/pipermail/u-boot/2006-March/013697.html but a simple client would be helpful in many situations. If a port of the redboot functionality is done - any thoughts on if it would be accepted? ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
Re: [U-Boot] http client?
Hi Robin, Robin Getz wrote: Sorry - first time I sent this -- I forgot to cc the list... On Tue 21 Jul 2009 12:37, Robin Getz pondered: redboot supports (and has since 2002) a mini-http client: This is just a transfer data via the network using HTTP protocol, no better or worse than tftp. (no https, no proxy, no other protocols). http://ecos.sourceware.org/cgi-bin/cvsweb.cgi/ecos/packages/redboot/current/src/net/http_client.c?rev=1.11content-type=text/x-cvsweb-markupcvsroot=ecos I know there have been discussions about adding wget to U-Boot, which I agree is not something that is worthwhile to do. http://lists.denx.de/pipermail/u-boot/2006-March/013697.html but a simple client would be helpful in many situations. If a port of the redboot functionality is done - any thoughts on if it would be accepted? I have no philosophical objection - in fact it seems kinda cool. As always, if you're able to make a good case for why something should be included, it probably will be. cheers, Ben ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot