Re: [U-Boot] [PATCH] Initial support for Orion5x SoC and EDMini board
Hi Prafulla and all, Prafulla Wadaskar a écrit : -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Albert Aribaud Sent: Saturday, November 14, 2009 6:32 AM To: U-Boot@lists.denx.de Subject: [U-Boot] [PATCH] Initial support for Orion5x SoC and EDMini board This patch adds initial u-boot support for the Marvell orion5x SoC and the LAcie ED Mini V2 board--support is limited to serial, flash and environment. Further support will be added as devices common with kirkwood are made useable across SoCs. Signed-off-by: Albert Aribaud albert.arib...@free.fr --- Hi Albert Please break this patch in to small pieces [...] Pls edit MAKEALL and Maintainers files too for new board support [...] Arm: add Edminv2 board support (orion5x based) Ok. Break this in to basic orion5x Soc support patch And individual drivers patches like gpio, uart, etc.. Will do. What exact criteria should I use for splitting patches? Obviously some patches will never be compiled alone, e.g. basic Orion5x support won't be compiled until board support patches come in; also, having SoC and board support without uart support, if it even compiles, will be pretty useless as the resulting u-boot won't even have a console. +# (C) Copyright 2009 +# Marvell Semiconductor www.marvell.com +# Written-by: Prafulla Wadaskar prafu...@marvell.com This is copy paste mistake, pls correct in all files You can keep my reference, i.e. based on (ref: boards/Marvell/openrd_base/openrd_base.c) Ok. +TEXT_BASE = 0x0060 Is this valid for your board? BTW: how much DRAM you have on this board? Yes it works for the board--I'm using this value for testing. However, in very old and non-reuseable u-boot code, it was 0x00F0. I'll switch to this in order to minimize the difference between these older u-boots and the current mainline one. The board has 64M RAM. + /* + * default gpio configuration + * There are maximum 64 gpios controlled through 2 sets of registers I don't think there are 64 GPIOs in orion5x Right, I'll fix the comment. That's 24 (with only 20 actually referenced by the board). + orion5x_config_gpio(EDMINIV2_OE_VAL_LOW, EDMINIV2_OE_LOW); You can eliminate LOW here, since mpps less than 3 Pls remove word LOW here Ok. diff --git a/cpu/arm926ejs/orion5x/Makefile [...] +COBJS-y = dram.o +COBJS-y += cpu.o Pls put these lines in order Ok. Note this comes directly from kirkwood's Makefile, so the lines are in the same order (dram, cpu, mpp, timer) there too. + * There are maximum 64 Multi-Pourpose Pins on Orion5x Correct this -64 Will do. +#define PCIE_DEV_ID_OFF (ORION5X_REG_PCIE_BASE + 0x) +#define PCIE_DEV_REV_OFF(ORION5X_REG_PCIE_BASE + 0x0008) Pls move the defination to header file Will do. + if (dev == MV88F5181_DEV_ID) { + dev_name = MV88F5181; + if (rev == MV88F5181_REV_B1) { + rev_name = B1; + } else if (rev == MV88F5181L_REV_A1) { + dev_name = MV88F5181L; + rev_name = A1; + } else if (rev == MV88F5181L_REV_A0) { + dev_name = MV88F5181L; + rev_name = A0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F5182_DEV_ID) { + dev_name = MV88F5182; + if (rev == MV88F5182_REV_A2) { + rev_name = A2; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F5281_DEV_ID) { + dev_name = MV88F5281; + if (rev == MV88F5281_REV_D2) { + rev_name = D2; + } else if (rev == MV88F5281_REV_D1) { + rev_name = D1; + } else if (rev == MV88F5281_REV_D0) { + rev_name = D0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F6183_DEV_ID) { + dev_name = MV88F6183; + if (rev == MV88F6183_REV_B0) { + rev_name = B0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else { + sprintf(dev_str,0x%04x, rev); + sprintf(rev_str,0x%02x, rev); This is common line, pls take out of if-else Can you be more specific? The outer 'if' sequence deals with device id and I see no no common line in its then/.../else branches, and the inner ifs are for revision and again, I cannot pinpoint the common line. Unless you would want the sprintf's to be done inconditionally before entering the if's? Note however that there is a typo: + } else { + sprintf(dev_str,0x%04x, rev); + sprintf(rev_str,0x%02x, rev); Should
Re: [U-Boot] [PATCH] Initial support for Orion5x SoC and EDMini board
-Original Message- From: Albert ARIBAUD [mailto:albert.arib...@free.fr] Sent: Saturday, November 14, 2009 2:53 PM To: Prafulla Wadaskar Cc: U-Boot@lists.denx.de; Ashish Karkare; Prabhanjan Sarnaik Subject: Re: [U-Boot] [PATCH] Initial support for Orion5x SoC and EDMini board Hi Prafulla and all, Prafulla Wadaskar a écrit : -Original Message- From: u-boot-boun...@lists.denx.de [mailto:u-boot-boun...@lists.denx.de] On Behalf Of Albert Aribaud Sent: Saturday, November 14, 2009 6:32 AM To: U-Boot@lists.denx.de Subject: [U-Boot] [PATCH] Initial support for Orion5x SoC and EDMini board This patch adds initial u-boot support for the Marvell orion5x SoC and the LAcie ED Mini V2 board--support is limited to serial, flash and environment. Further support will be added as devices common with kirkwood are made useable across SoCs. Signed-off-by: Albert Aribaud albert.arib...@free.fr --- Hi Albert Please break this patch in to small pieces [...] Pls edit MAKEALL and Maintainers files too for new board support [...] Arm: add Edminv2 board support (orion5x based) Ok. Break this in to basic orion5x Soc support patch And individual drivers patches like gpio, uart, etc.. Will do. What exact criteria should I use for splitting patches? Obviously some patches will never be compiled alone, e.g. basic Orion5x support won't be compiled until board support patches come in; also, having SoC and board support without uart support, if it even compiles, will be pretty useless as the resulting u-boot won't even have a console. It should be patch series with properly addressed dependencies i.e. (1/4)basic orion soc support patch (2/4)orion gpio driver (3/4)orion UART support (4/4) Board support patch All patches when applied in series should build u-boot for respective board. The spilt has to be done carefully because individual patch may be applied to different repositories, like nandf to u-boot-nand.git, basic orion support to u-boot-marvell.git, egiga driver patch will go in u-boot-net.git etc +TEXT_BASE = 0x0060 Is this valid for your board? BTW: how much DRAM you have on this board? Yes it works for the board--I'm using this value for testing. However, in very old and non-reuseable u-boot code, it was 0x00F0. I'll switch to this in order to minimize the difference between these older u-boots and the current mainline one. I will suggest to use lower part of available ram for this diff --git a/cpu/arm926ejs/orion5x/Makefile [...] +COBJS-y = dram.o +COBJS-y += cpu.o Pls put these lines in order Ok. Note this comes directly from kirkwood's Makefile, so the lines are Thanks , I will provide separate patch for this + if (dev == MV88F5181_DEV_ID) { + dev_name = MV88F5181; + if (rev == MV88F5181_REV_B1) { + rev_name = B1; + } else if (rev == MV88F5181L_REV_A1) { + dev_name = MV88F5181L; + rev_name = A1; + } else if (rev == MV88F5181L_REV_A0) { + dev_name = MV88F5181L; + rev_name = A0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F5182_DEV_ID) { + dev_name = MV88F5182; + if (rev == MV88F5182_REV_A2) { + rev_name = A2; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F5281_DEV_ID) { + dev_name = MV88F5281; + if (rev == MV88F5281_REV_D2) { + rev_name = D2; + } else if (rev == MV88F5281_REV_D1) { + rev_name = D1; + } else if (rev == MV88F5281_REV_D0) { + rev_name = D0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F6183_DEV_ID) { + dev_name = MV88F6183; + if (rev == MV88F6183_REV_B0) { + rev_name = B0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else { + sprintf(dev_str,0x%04x, rev); + sprintf(rev_str,0x%02x, rev); This is common line, pls take out of if-else Can you be more specific? The outer 'if' sequence deals with device id Okay I will take this back Whereas I found + sprintf(rev_str,0x%02x, rev); At so many places, can you reduce it? Is this Marvell custom board ? If not, even you can choose to keep in in boards instead of boards/Marvell/ No, it's not a Marvell custom board, it's a LaCie product board. I'll move the board to boards/ directly (or maybe boards/lacie, to provide a home for other lacie
Re: [U-Boot] [PATCH] Initial support for Orion5x SoC and EDMini board
Hi again Prafulla, Prafulla Wadaskar a écrit : Break this in to basic orion5x Soc support patch And individual drivers patches like gpio, uart, etc.. Will do. What exact criteria should I use for splitting patches? Obviously some patches will never be compiled alone, e.g. basic Orion5x support won't be compiled until board support patches come in; also, having SoC and board support without uart support, if it even compiles, will be pretty useless as the resulting u-boot won't even have a console. It should be patch series with properly addressed dependencies i.e. (1/4)basic orion soc support patch (2/4)orion gpio driver (3/4)orion UART support (4/4) Board support patch All patches when applied in series should build u-boot for respective board. The spilt has to be done carefully because individual patch may be applied to different repositories, like nandf to u-boot-nand.git, basic orion support to u-boot-marvell.git, egiga driver patch will go in u-boot-net.git etc Duly noted. Currently, I only add support for SoC, UART and NOT FLASH (not NAND) so only u-boot-marvell.git needs to be considered; I'll keep other repos in mind for upcoming patches like egiga and others. +TEXT_BASE = 0x0060 Is this valid for your board? BTW: how much DRAM you have on this board? Yes it works for the board--I'm using this value for testing. However, in very old and non-reuseable u-boot code, it was 0x00F0. I'll switch to this in order to minimize the difference between these older u-boots and the current mainline one. I will suggest to use lower part of available ram for this Understood. Note the 0x0060 value comes from kirkwood too, in case this matters. + if (dev == MV88F5181_DEV_ID) { + dev_name = MV88F5181; + if (rev == MV88F5181_REV_B1) { + rev_name = B1; + } else if (rev == MV88F5181L_REV_A1) { + dev_name = MV88F5181L; + rev_name = A1; + } else if (rev == MV88F5181L_REV_A0) { + dev_name = MV88F5181L; + rev_name = A0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F5182_DEV_ID) { + dev_name = MV88F5182; + if (rev == MV88F5182_REV_A2) { + rev_name = A2; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F5281_DEV_ID) { + dev_name = MV88F5281; + if (rev == MV88F5281_REV_D2) { + rev_name = D2; + } else if (rev == MV88F5281_REV_D1) { + rev_name = D1; + } else if (rev == MV88F5281_REV_D0) { + rev_name = D0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else if (dev == MV88F6183_DEV_ID) { + dev_name = MV88F6183; + if (rev == MV88F6183_REV_B0) { + rev_name = B0; + } else { + sprintf(rev_str,0x%02x, rev); + } + } else { + sprintf(dev_str,0x%04x, rev); + sprintf(rev_str,0x%02x, rev); This is common line, pls take out of if-else Can you be more specific? The outer 'if' sequence deals with device id Okay I will take this back Whereas I found + sprintf(rev_str,0x%02x, rev); At so many places, can you reduce it? Hmm yes, I think I can start by setting dev_name/rev_name tu NULL, go through the ifs and set dev_name/rev_name only if appropriate, and then do the sprintf()s only if dev_name/rev_name are still NULL after the ifs. Is this Marvell custom board ? If not, even you can choose to keep in in boards instead of boards/Marvell/ No, it's not a Marvell custom board, it's a LaCie product board. I'll move the board to boards/ directly (or maybe boards/lacie, to provide a home for other lacie boards? Any best pratice here to follow?) and change the prompt to EDMiniV2. That's good approach for this board, if you are planning to put support for more Lacie boards, then its better to have boards/lacie I guess there's at least a second one to come, so I'll go for the boards/lacie/* approach. Regards.. Prafulla . . Thanks again! Amicalement, -- Albert. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] Cute Kid of the Year - enter to win $25,000
Welcome to The CuteKid, the internet’s largest online child photo contest! Judged by professional talent and casting agents. Do you have a Cute Kid? If so, we invite you to join our growing community of loving parents just like you by submitting a photo of YOUR cute kid for a chance to win a $25,000 College Tuition Fund! Submit your photo today! http://promo.iammyownboss.co.uk Enter today and receive instant rewards like a 1 year subscription to Parenting Magazine and a 8X10 Canvas portrait of your photo. If you have a cute kid that is just waiting to be discovered, don’t delay. Membership is free and easy – Sign Up Today! http://promo.iammyownboss.co.uk For more information about the 2008 CuteKid™ of the Year Contest, please visit our How it Works page. If you seek more information including our address, Click here. http://promo.iammyownboss.co.uk -- If you do not want to receive any more newsletters, http://www.solduk.com/design/mailer/?p=unsubscribeuid=af86ba5c2aaa2d9e36cb3507d85fa01d To update your preferences and to unsubscribe visit http://www.solduk.com/design/mailer/?p=preferencesuid=af86ba5c2aaa2d9e36cb3507d85fa01d Forward a Message to Someone http://www.solduk.com/design/mailer/?p=forwarduid=af86ba5c2aaa2d9e36cb3507d85fa01dmid=4 -- Powered by PHPlist, www.phplist.com -- inline: powerphplist.png___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 3/3] Add support for the LaCie ED Mini V2 board
This board is based on the Marvell Orion5x SoC. Current support is limited to console and Flash. Flash support uses LEGACY as the Macronix 29LV400 used on ED Mini V2 is not 100% CFI compliant. Signed-off-by: Albert Aribaud albert.arib...@free.fr --- MAINTAINERS |4 + MAKEALL |1 + Makefile|3 + board/LaCie/edminiv2/Makefile | 54 +++ board/LaCie/edminiv2/config.mk | 27 +++ board/LaCie/edminiv2/edminiv2.c | 134 board/LaCie/edminiv2/edminiv2.h | 43 include/configs/edminiv2.h | 143 +++ 8 files changed, 409 insertions(+), 0 deletions(-) create mode 100644 board/LaCie/edminiv2/Makefile create mode 100644 board/LaCie/edminiv2/config.mk create mode 100644 board/LaCie/edminiv2/edminiv2.c create mode 100644 board/LaCie/edminiv2/edminiv2.h create mode 100644 include/configs/edminiv2.h diff --git a/MAINTAINERS b/MAINTAINERS index d70a9d2..93e57f5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -512,6 +512,10 @@ Unknown / orphaned boards: # Board CPU # # +Albert ARIBAUD albert.arib...@free.fr + + edminiv2ARM926EJS (Orion5x SoC) + Rowel Atienza ro...@diwalabs.com armadillo ARM720T diff --git a/MAKEALL b/MAKEALL index d63c5c2..f7b2a24 100755 --- a/MAKEALL +++ b/MAKEALL @@ -548,6 +548,7 @@ LIST_ARM9= \ cp926ejs\ cp946es \ cp966 \ + edminiv2\ imx27lite \ lpd7a400\ mv88f6281gtw_ge \ diff --git a/Makefile b/Makefile index bcb3fe9..83b35b5 100644 --- a/Makefile +++ b/Makefile @@ -2951,6 +2951,9 @@ davinci_dm365evm_config : unconfig davinci_dm6467evm_config : unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs dm6467evm davinci davinci +edminiv2_config: unconfig + @$(MKCONFIG) $(@:_config=) arm arm926ejs $(@:_config=) LaCie orion5x + imx27lite_config: unconfig @$(MKCONFIG) $(@:_config=) arm arm926ejs imx27lite logicpd mx27 diff --git a/board/LaCie/edminiv2/Makefile b/board/LaCie/edminiv2/Makefile new file mode 100644 index 000..6543da0 --- /dev/null +++ b/board/LaCie/edminiv2/Makefile @@ -0,0 +1,54 @@ +# +# Copyright (C) 2009 Albert ARIBAUD albrt.arib...@free.fr +# +# Based on original Kirkwood support which is +# (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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(BOARD).a + +COBJS := edminiv2.o + +SRCS := $(SOBJS:.o=.S) $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) +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 .depend + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/board/LaCie/edminiv2/config.mk b/board/LaCie/edminiv2/config.mk new file mode 100644 index 000..9c725d3 --- /dev/null +++ b/board/LaCie/edminiv2/config.mk @@ -0,0 +1,27 @@ +# +# Copyright (C) 2009 Albert ARIBAUD albrt.arib...@free.fr +# +# (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
[U-Boot] [PATCH V2 2/3] Add Orion5x support to 16550 serial device driver
This patch provides access to the 16550-compatible serial device of the Orion5x SoC. Signed-off-by: Albert Aribaud albert.arib...@free.fr --- drivers/serial/serial.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/serial/serial.c b/drivers/serial/serial.c index dd5f332..18686a2 100644 --- a/drivers/serial/serial.c +++ b/drivers/serial/serial.c @@ -30,6 +30,9 @@ #ifdef CONFIG_KIRKWOOD #include asm/arch/kirkwood.h #endif +#ifdef CONFIG_ORION5X +#include asm/arch/orion5x.h +#endif #if defined (CONFIG_SERIAL_MULTI) #include serial.h -- 1.6.4.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH V2 1/3] Initial support for Marvell Orion5x SoC
This patch adds support for the Marvell Orion5x SoC. It has no use alone, and must be followed by a patch to add Orion5x support for serial, then support for the ED Mini V2, an Orion5x-based board from LaCie. Signed-off-by: Albert Aribaud albert.arib...@free.fr --- cpu/arm926ejs/orion5x/Makefile | 52 + cpu/arm926ejs/orion5x/cpu.c| 332 cpu/arm926ejs/orion5x/dram.c | 61 ++ cpu/arm926ejs/orion5x/mpp.c| 89 + cpu/arm926ejs/orion5x/timer.c | 175 + include/asm-arm/arch-orion5x/88f5182.h | 40 include/asm-arm/arch-orion5x/cpu.h | 213 include/asm-arm/arch-orion5x/gpio.h| 52 + include/asm-arm/arch-orion5x/mpp.h | 122 include/asm-arm/arch-orion5x/orion5x.h | 67 +++ 10 files changed, 1203 insertions(+), 0 deletions(-) create mode 100644 cpu/arm926ejs/orion5x/Makefile create mode 100644 cpu/arm926ejs/orion5x/cpu.c create mode 100644 cpu/arm926ejs/orion5x/dram.c create mode 100644 cpu/arm926ejs/orion5x/mpp.c create mode 100644 cpu/arm926ejs/orion5x/timer.c create mode 100644 include/asm-arm/arch-orion5x/88f5182.h create mode 100644 include/asm-arm/arch-orion5x/cpu.h create mode 100644 include/asm-arm/arch-orion5x/gpio.h create mode 100644 include/asm-arm/arch-orion5x/mpp.h create mode 100644 include/asm-arm/arch-orion5x/orion5x.h diff --git a/cpu/arm926ejs/orion5x/Makefile b/cpu/arm926ejs/orion5x/Makefile new file mode 100644 index 000..3343124 --- /dev/null +++ b/cpu/arm926ejs/orion5x/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2009 Albert ARIBAUD albrt.arib...@free.fr +# +# Based on original Kirkwood support which is +# (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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(SOC).a + +COBJS-y= cpu.o +COBJS-y+= dram.o +COBJS-y+= mpp.o +COBJS-y+= timer.o + +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y)) + +all: $(obj).depend $(LIB) + +$(LIB):$(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/cpu/arm926ejs/orion5x/cpu.c b/cpu/arm926ejs/orion5x/cpu.c new file mode 100644 index 000..8f1806e --- /dev/null +++ b/cpu/arm926ejs/orion5x/cpu.c @@ -0,0 +1,332 @@ +/* + * Copyright (C) 2009 Albert ARIBAUD albert.arib...@free.fr + * + * Based on original Kirkwood support which is + * (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 + */ + +#include common.h +#include netdev.h +#include asm/cache.h +#include u-boot/md5.h +#include asm/arch/orion5x.h +#include hush.h + +#define BUFLEN 16 + +void reset_cpu(unsigned long ignored) +{ + struct orion5x_cpu_registers *cpureg = + (struct orion5x_cpu_registers *)ORION5X_CPU_REG_BASE; + + writel(readl(cpureg-rstoutn_mask) | (1 2), + cpureg-rstoutn_mask); + writel(readl(cpureg-sys_soft_rst) | 1, + cpureg-sys_soft_rst); +
[U-Boot] [PATCH 4/4 v4] DA830: Add usb config
Adding USB configuration. Default is set for USB MSC host. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- include/configs/da830evm.h | 38 +- 1 files changed, 33 insertions(+), 5 deletions(-) diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h index 38e2ce1..432cd57 100644 --- a/include/configs/da830evm.h +++ b/include/configs/da830evm.h @@ -149,6 +149,11 @@ #define CONFIG_SYS_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED #endif +/* + * USB configuration + */ +#define CONFIG_USB_DA8XX /* Platform hookup to MUSB controller */ +#define CONFIG_MUSB_HCD /* * U-Boot general configuration @@ -234,10 +239,33 @@ #endif #ifdef CONFIG_USB_DA8XX -#define CONFIG_CMD_USB /* include support for usb */ -#define CONFIG_CMD_STORAGE /* include support for usb */ -#define CONFIG_CMD_FAT /* include support for FAT/storage*/ -#define CONFIG_DOS_PARTITION /* include support for FAT/storage*/ -#endif +#ifdef CONFIG_MUSB_HCD /* include support for usb host */ +#define CONFIG_CMD_USB /* include support for usb cmd */ + +#define CONFIG_USB_STORAGE /* MSC class support */ +#define CONFIG_CMD_STORAGE /* inclue support for usb-storage cmd */ +#define CONFIG_CMD_FAT /* inclue support for FAT/storage */ +#define CONFIG_DOS_PARTITION /* inclue support for FAT/storage */ + +#ifdef CONFIG_USB_KEYBOARD /* HID class support */ +#define CONFIG_SYS_USB_EVENT_POLL +#define CONFIG_PREBOOT usb start +#endif /* CONFIG_USB_KEYBOARD */ + +#endif /* CONFIG_MUSB_HCD */ + +#ifdef CONFIG_MUSB_UDC +/* USB device configuration */ +#define CONFIG_USB_DEVICE 1 +#define CONFIG_USB_TTY 1 +#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 +/* Change these to suit your needs */ +#define CONFIG_USBD_VENDORID 0x0451 +#define CONFIG_USBD_PRODUCTID 0x5678 +#define CONFIG_USBD_MANUFACTURER Texas Instruments +#define CONFIG_USBD_PRODUCT_NAME DA830EVM +#endif /* CONFIG_MUSB_UDC */ + +#endif /* CONFIG_USB_DA8XX */ #endif /* __CONFIG_H */ -- 1.6.2.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/4 v4] DA8xx: Add GPIO register definitions
Added DA8xx GPIO base addresses in gpio_defs.h and pointers to different BANKs which can be used to program GPIOs. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- include/asm-arm/arch-davinci/gpio_defs.h | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/include/asm-arm/arch-davinci/gpio_defs.h b/include/asm-arm/arch-davinci/gpio_defs.h index ff62976..1be2ac2 100644 --- a/include/asm-arm/arch-davinci/gpio_defs.h +++ b/include/asm-arm/arch-davinci/gpio_defs.h @@ -22,12 +22,21 @@ #ifndef _GPIO_DEFS_H_ #define _GPIO_DEFS_H_ +#ifndef CONFIG_SOC_DA8XX #define DAVINCI_GPIO_BINTEN0x01C67008 #define DAVINCI_GPIO_BANK010x01C67010 #define DAVINCI_GPIO_BANK230x01C67038 #define DAVINCI_GPIO_BANK450x01C67060 #define DAVINCI_GPIO_BANK670x01C67088 +#else /* CONFIG_SOC_DA8XX */ +#define DAVINCI_GPIO_BINTEN0x01E26008 +#define DAVINCI_GPIO_BANK010x01E26010 +#define DAVINCI_GPIO_BANK230x01E26038 +#define DAVINCI_GPIO_BANK450x01E26060 +#define DAVINCI_GPIO_BANK670x01E26088 +#endif /* CONFIG_SOC_DA8XX */ + struct davinci_gpio { unsigned int dir; unsigned int out_data; @@ -49,4 +58,9 @@ struct davinci_gpio_bank { unsigned long base; }; +#define davinci_gpio_bank01 ((struct davinci_gpio *)DAVINCI_GPIO_BANK01) +#define davinci_gpio_bank23 ((struct davinci_gpio *)DAVINCI_GPIO_BANK23) +#define davinci_gpio_bank45 ((struct davinci_gpio *)DAVINCI_GPIO_BANK45) +#define davinci_gpio_bank67 ((struct davinci_gpio *)DAVINCI_GPIO_BANK67) + #endif -- 1.6.2.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/4 v4] DA8xx: USB support
Hi, These patch set have been created against uboot-ti/master branch. Changes from previous version are, - Used C structure for DA8xx usb registers. I didn't modify the alignment in include/usb.h as Nick suggested, would wait for Remy Bohmer's comment on this. Regards, Ajay Ajay Kumar Gupta (4): DA830: Add pinmux for USB0_DRVVBUS DA8xx: Add GPIO register definitions DA8xx: Add MUSB host support DA830: Add usb config board/davinci/da830evm/da830evm.c|8 ++ drivers/usb/musb/Makefile|1 + drivers/usb/musb/da8xx.c | 139 ++ drivers/usb/musb/da8xx.h | 103 ++ include/asm-arm/arch-davinci/gpio_defs.h | 14 +++ include/configs/da830evm.h | 38 +++- include/usb.h|3 +- 7 files changed, 300 insertions(+), 6 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 1/4 v4] DA830: Add pinmux for USB0_DRVVBUS
USB0_DRVVBUS pinmux configuration is required for USB functinality in uboot. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- board/davinci/da830evm/da830evm.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/board/davinci/da830evm/da830evm.c b/board/davinci/da830evm/da830evm.c index bb8cc3c..7cf6013 100644 --- a/board/davinci/da830evm/da830evm.c +++ b/board/davinci/da830evm/da830evm.c @@ -65,6 +65,11 @@ const struct pinmux_config i2c_pins[] = { { pinmux[9], 2, 4 } }; +/* USB0_DRVVBUS pin muxer settings */ +const struct pinmux_config usb_pins[] = { + { pinmux[9], 1, 1 } +}; + int board_init(void) { #ifndef CONFIG_USE_IRQ @@ -118,6 +123,9 @@ int board_init(void) if (davinci_configure_pin_mux(i2c_pins, ARRAY_SIZE(i2c_pins)) != 0) return 1; + if (davinci_configure_pin_mux(usb_pins, ARRAY_SIZE(usb_pins)) != 0) + return 1; + /* enable the console UART */ writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST | DAVINCI_UART_PWREMU_MGMT_UTRST), -- 1.6.2.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/4 v4] DA8xx: Add MUSB host support
Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- drivers/usb/musb/Makefile |1 + drivers/usb/musb/da8xx.c | 139 + drivers/usb/musb/da8xx.h | 103 + include/usb.h |3 +- 4 files changed, 245 insertions(+), 1 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 09e0a5f..eb4d8fd 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile @@ -27,6 +27,7 @@ LIB := $(obj)libusb_musb.a COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o COBJS-$(CONFIG_USB_DAVINCI) += davinci.o +COBJS-$(CONFIG_USB_DA8XX) += da8xx.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c new file mode 100644 index 000..8f480d4 --- /dev/null +++ b/drivers/usb/musb/da8xx.c @@ -0,0 +1,139 @@ +/* + * da8xx.c - TI's DA8xx platform specific usb wrapper functions. + * + * Author: Ajay Kumar Gupta ajay.gu...@ti.com + * + * Based on drivers/usb/musb/davinci.c + * + * Copyright (C) 2009 Texas Instruments Incorporated + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include common.h + +#include da8xx.h + +/* MUSB platform configuration */ +struct musb_config musb_cfg = { + (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE, + DA8XX_USB_OTG_TIMEOUT, + 0 +}; + +/* + * This function enables VBUS by driving the GPIO Bank4 Pin 15 high. + */ +static void enable_vbus(void) +{ + u32 value; + + /* configure GPIO bank4 pin 15 in output direction */ + value = readl(davinci_gpio_bank45-dir); + writel((value (~DA8XX_USB_VBUS_GPIO)), davinci_gpio_bank45-dir); + + /* set GPIO bank4 pin 15 high to drive VBUS */ + value = readl(davinci_gpio_bank45-set_data); + writel((value | DA8XX_USB_VBUS_GPIO), davinci_gpio_bank45-set_data); +} + +/* + * Enable the usb0 phy. This initialization procedure is explained in + * the DA8xx USB user guide document. + */ +static u8 phy_on(void) +{ + u32 timeout; + u32 cfgchip2; + + cfgchip2 = readl(davinci_syscfg_regs-cfgchip2); + + cfgchip2 = ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN | + CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ); + cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON | + CFGCHIP2_REFFREQ_24MHZ; + + writel(cfgchip2, davinci_syscfg_regs-cfgchip2); + + /* wait until the usb phy pll locks */ + timeout = musb_cfg.timeout; + while (timeout--) + if (readl(davinci_syscfg_regs-cfgchip2) CFGCHIP2_PHYCLKGD) + return 1; + + /* USB phy was not turned on */ + return 0; +} + +/* + * Disable the usb phy + */ +static void phy_off(void) +{ + u32 cfgchip2; + + /* +* Power down the on-chip PHY. +*/ + cfgchip2 = readl(davinci_syscfg_regs-cfgchip2); + cfgchip2 = ~CFGCHIP2_PHY_PLLON; + cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN; + writel(cfgchip2, davinci_syscfg_regs-cfgchip2); +} + +/* + * This function performs DA8xx platform specific initialization for usb0. + */ +int musb_platform_init(void) +{ + u32 revision; + + /* enable psc for usb2.0 */ + lpsc_on(33); + + /* enable usb vbus */ + enable_vbus(); + + /* reset the controller */ + writel(0x1, da8xx_usb_regs-control); + udelay(5000); + + /* start the on-chip usb phy and its pll */ + if (phy_on() == 0) + return -1; + + /* Returns zero if e.g. not clocked */ + revision = readl(da8xx_usb_regs-revision); + if (revision == 0) + return -1; + + /* Disable all interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_set); + return 0; +} + +/* + * This function performs DA8xx platform specific deinitialization for usb0. + */ +void musb_platform_deinit(void) +{ + /* Turn of the phy */ + phy_off(); + + /* flush any interrupts */ +
Re: [U-Boot] [PATCH 3/4 v4] DA8xx: Add MUSB host support
Hi, -Original Message- From: Gupta, Ajay Kumar Sent: Sunday, November 15, 2009 11:04 AM To: u-boot@lists.denx.de Cc: li...@bohmer.net; tom@windriver.com; Gupta, Ajay Kumar; Subbrathnam, Swaminathan Subject: [PATCH 3/4 v4] DA8xx: Add MUSB host support Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- drivers/usb/musb/Makefile |1 + drivers/usb/musb/da8xx.c | 139 + drivers/usb/musb/da8xx.h | 103 + include/usb.h |3 +- 4 files changed, 245 insertions(+), 1 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 09e0a5f..eb4d8fd 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile snip.. + + /* reset the controller */ + writel(0x1, da8xx_usb_regs-control); + udelay(5000); + + /* start the on-chip usb phy and its pll */ + if (phy_on() == 0) + return -1; + + /* Returns zero if e.g. not clocked */ + revision = readl(da8xx_usb_regs-revision); '' is missing, will resubmit the patch set. Regards, Ajay + if (revision == 0) + return -1; + + /* Disable all interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_set); + return 0; +} + +/* + * This function performs DA8xx platform specific deinitialization for usb0. + */ +void musb_platform_deinit(void) +{ + /* Turn of the phy */ + phy_off(); + + /* flush any interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_clr); + writel(0, da8xx_usb_regs-eoi); +} diff --git a/drivers/usb/musb/da8xx.h b/drivers/usb/musb/da8xx.h new file mode 100644 index 000..93234f0 --- /dev/null +++ b/drivers/usb/musb/da8xx.h @@ -0,0 +1,103 @@ +/* + * da8xx.h -- TI's DA8xx platform specific usb wrapper definitions. + * + * Author: Ajay Kumar Gupta ajay.gu...@ti.com + * + * Based on drivers/usb/musb/davinci.h + * + * Copyright (C) 2009 Texas Instruments Incorporated + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#ifndef __DA8XX_MUSB_H__ +#define __DA8XX_MUSB_H__ + +#include asm/arch/hardware.h +#include asm/arch/gpio_defs.h +#include musb_core.h + +/* Base address of da8xx usb0 wrapper */ +#define DA8XX_USB_OTG_BASE 0x01E0 + +/* Base address of da8xx musb core */ +#define DA8XX_USB_OTG_CORE_BASE (DA8XX_USB_OTG_BASE + 0x400) + +/* Timeout for DA8xx usb module */ +#define DA8XX_USB_OTG_TIMEOUT 0x3FF + +/* + * DA8xx platform USB wrapper register overlay. + */ +struct da8xx_usb_regs { + dv_reg revision; + dv_reg control; + dv_reg status; + dv_reg emulation; + dv_reg mode; + dv_reg autoreq; + dv_reg srpfixtime; + dv_reg teardown; + dv_reg intsrc; + dv_reg intsrc_set; + dv_reg intsrc_clr; + dv_reg intmsk; + dv_reg intmsk_set; + dv_reg intmsk_clr; + dv_reg intsrcmsk; + dv_reg eoi; + dv_reg intvector; + dv_reg grndis_size[4]; +}; + +#define da8xx_usb_regs ((struct da8xx_usb_regs *)DA8XX_USB_OTG_BASE) + +/* DA8XX interrupt bits definitions */ +#define DA8XX_USB_TX_ENDPTS_MASK 0x1f /* ep0 + 4 tx */ +#define DA8XX_USB_RX_ENDPTS_MASK 0x1e /* 4 rx */ +#define DA8XX_USB_TXINT_SHIFT 0 +#define DA8XX_USB_RXINT_SHIFT 8 + +#define DA8XX_USB_USBINT_MASK 0x01ff/* 8 Mentor, DRVVBUS */ +#define DA8XX_USB_TXINT_MASK \ + (DA8XX_USB_TX_ENDPTS_MASK DA8XX_USB_TXINT_SHIFT) +#define DA8XX_USB_RXINT_MASK \ + (DA8XX_USB_RX_ENDPTS_MASK DA8XX_USB_RXINT_SHIFT) + +/* DA8xx CFGCHIP2 (USB 2.0 PHY Control) register bits */ +#define CFGCHIP2_PHYCLKGD(1 17) +#define CFGCHIP2_VBUSSENSE (1 16) +#define CFGCHIP2_RESET (1 15) +#define CFGCHIP2_OTGMODE (3 13) +#define CFGCHIP2_NO_OVERRIDE (0 13) +#define CFGCHIP2_FORCE_HOST (1 13) +#define
[U-Boot] [PATCH 1/4 v5] DA830: Add pinmux for USB0_DRVVBUS
USB0_DRVVBUS pinmux configuration is required for USB functinality in uboot. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- board/davinci/da830evm/da830evm.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/board/davinci/da830evm/da830evm.c b/board/davinci/da830evm/da830evm.c index bb8cc3c..7cf6013 100644 --- a/board/davinci/da830evm/da830evm.c +++ b/board/davinci/da830evm/da830evm.c @@ -65,6 +65,11 @@ const struct pinmux_config i2c_pins[] = { { pinmux[9], 2, 4 } }; +/* USB0_DRVVBUS pin muxer settings */ +const struct pinmux_config usb_pins[] = { + { pinmux[9], 1, 1 } +}; + int board_init(void) { #ifndef CONFIG_USE_IRQ @@ -118,6 +123,9 @@ int board_init(void) if (davinci_configure_pin_mux(i2c_pins, ARRAY_SIZE(i2c_pins)) != 0) return 1; + if (davinci_configure_pin_mux(usb_pins, ARRAY_SIZE(usb_pins)) != 0) + return 1; + /* enable the console UART */ writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST | DAVINCI_UART_PWREMU_MGMT_UTRST), -- 1.6.2.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 2/4 v5] DA8xx: Add GPIO register definitions
Added DA8xx GPIO base addresses in gpio_defs.h and pointers to different BANKs which can be used to program GPIOs. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- include/asm-arm/arch-davinci/gpio_defs.h | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/include/asm-arm/arch-davinci/gpio_defs.h b/include/asm-arm/arch-davinci/gpio_defs.h index ff62976..1be2ac2 100644 --- a/include/asm-arm/arch-davinci/gpio_defs.h +++ b/include/asm-arm/arch-davinci/gpio_defs.h @@ -22,12 +22,21 @@ #ifndef _GPIO_DEFS_H_ #define _GPIO_DEFS_H_ +#ifndef CONFIG_SOC_DA8XX #define DAVINCI_GPIO_BINTEN0x01C67008 #define DAVINCI_GPIO_BANK010x01C67010 #define DAVINCI_GPIO_BANK230x01C67038 #define DAVINCI_GPIO_BANK450x01C67060 #define DAVINCI_GPIO_BANK670x01C67088 +#else /* CONFIG_SOC_DA8XX */ +#define DAVINCI_GPIO_BINTEN0x01E26008 +#define DAVINCI_GPIO_BANK010x01E26010 +#define DAVINCI_GPIO_BANK230x01E26038 +#define DAVINCI_GPIO_BANK450x01E26060 +#define DAVINCI_GPIO_BANK670x01E26088 +#endif /* CONFIG_SOC_DA8XX */ + struct davinci_gpio { unsigned int dir; unsigned int out_data; @@ -49,4 +58,9 @@ struct davinci_gpio_bank { unsigned long base; }; +#define davinci_gpio_bank01 ((struct davinci_gpio *)DAVINCI_GPIO_BANK01) +#define davinci_gpio_bank23 ((struct davinci_gpio *)DAVINCI_GPIO_BANK23) +#define davinci_gpio_bank45 ((struct davinci_gpio *)DAVINCI_GPIO_BANK45) +#define davinci_gpio_bank67 ((struct davinci_gpio *)DAVINCI_GPIO_BANK67) + #endif -- 1.6.2.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 4/4 v5] DA830: Add usb config
Adding USB configuration. Default is set for USB MSC host. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- include/configs/da830evm.h | 38 +- 1 files changed, 33 insertions(+), 5 deletions(-) diff --git a/include/configs/da830evm.h b/include/configs/da830evm.h index 38e2ce1..432cd57 100644 --- a/include/configs/da830evm.h +++ b/include/configs/da830evm.h @@ -149,6 +149,11 @@ #define CONFIG_SYS_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED #endif +/* + * USB configuration + */ +#define CONFIG_USB_DA8XX /* Platform hookup to MUSB controller */ +#define CONFIG_MUSB_HCD /* * U-Boot general configuration @@ -234,10 +239,33 @@ #endif #ifdef CONFIG_USB_DA8XX -#define CONFIG_CMD_USB /* include support for usb */ -#define CONFIG_CMD_STORAGE /* include support for usb */ -#define CONFIG_CMD_FAT /* include support for FAT/storage*/ -#define CONFIG_DOS_PARTITION /* include support for FAT/storage*/ -#endif +#ifdef CONFIG_MUSB_HCD /* include support for usb host */ +#define CONFIG_CMD_USB /* include support for usb cmd */ + +#define CONFIG_USB_STORAGE /* MSC class support */ +#define CONFIG_CMD_STORAGE /* inclue support for usb-storage cmd */ +#define CONFIG_CMD_FAT /* inclue support for FAT/storage */ +#define CONFIG_DOS_PARTITION /* inclue support for FAT/storage */ + +#ifdef CONFIG_USB_KEYBOARD /* HID class support */ +#define CONFIG_SYS_USB_EVENT_POLL +#define CONFIG_PREBOOT usb start +#endif /* CONFIG_USB_KEYBOARD */ + +#endif /* CONFIG_MUSB_HCD */ + +#ifdef CONFIG_MUSB_UDC +/* USB device configuration */ +#define CONFIG_USB_DEVICE 1 +#define CONFIG_USB_TTY 1 +#define CONFIG_SYS_CONSOLE_IS_IN_ENV 1 +/* Change these to suit your needs */ +#define CONFIG_USBD_VENDORID 0x0451 +#define CONFIG_USBD_PRODUCTID 0x5678 +#define CONFIG_USBD_MANUFACTURER Texas Instruments +#define CONFIG_USBD_PRODUCT_NAME DA830EVM +#endif /* CONFIG_MUSB_UDC */ + +#endif /* CONFIG_USB_DA8XX */ #endif /* __CONFIG_H */ -- 1.6.2.4 ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 0/4 v5] DA8xx: USB support
Hi, These patch set have been created against uboot-ti/master branch. Fixed missing '' in [PATCH 3/4] from previous version. I didn't modify the alignment in include/usb.h as Nick suggested, would wait for Remy Bohmer's comment on this. Regards, Ajay Ajay Kumar Gupta (4): DA830: Add pinmux for USB0_DRVVBUS DA8xx: Add GPIO register definitions DA8xx: Add MUSB host support DA830: Add usb config board/davinci/da830evm/da830evm.c|8 ++ drivers/usb/musb/Makefile|1 + drivers/usb/musb/da8xx.c | 139 ++ drivers/usb/musb/da8xx.h | 103 ++ include/asm-arm/arch-davinci/gpio_defs.h | 14 +++ include/configs/da830evm.h | 38 +++- include/usb.h|3 +- 7 files changed, 300 insertions(+), 6 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCH 3/4 v5] DA8xx: Add MUSB host support
Tested USB host functionality on DA830 EVM. Signed-off-by: Ajay Kumar Gupta ajay.gu...@ti.com Signed-off-by: Swaminathan S swami.i...@ti.com --- drivers/usb/musb/Makefile |1 + drivers/usb/musb/da8xx.c | 139 + drivers/usb/musb/da8xx.h | 103 + include/usb.h |3 +- 4 files changed, 245 insertions(+), 1 deletions(-) create mode 100644 drivers/usb/musb/da8xx.c create mode 100644 drivers/usb/musb/da8xx.h diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 09e0a5f..eb4d8fd 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile @@ -27,6 +27,7 @@ LIB := $(obj)libusb_musb.a COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o COBJS-$(CONFIG_USB_DAVINCI) += davinci.o +COBJS-$(CONFIG_USB_DA8XX) += da8xx.o COBJS := $(COBJS-y) SRCS := $(COBJS:.o=.c) diff --git a/drivers/usb/musb/da8xx.c b/drivers/usb/musb/da8xx.c new file mode 100644 index 000..40bfe44 --- /dev/null +++ b/drivers/usb/musb/da8xx.c @@ -0,0 +1,139 @@ +/* + * da8xx.c - TI's DA8xx platform specific usb wrapper functions. + * + * Author: Ajay Kumar Gupta ajay.gu...@ti.com + * + * Based on drivers/usb/musb/davinci.c + * + * Copyright (C) 2009 Texas Instruments Incorporated + * + * 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., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +#include common.h + +#include da8xx.h + +/* MUSB platform configuration */ +struct musb_config musb_cfg = { + (struct musb_regs *)DA8XX_USB_OTG_CORE_BASE, + DA8XX_USB_OTG_TIMEOUT, + 0 +}; + +/* + * This function enables VBUS by driving the GPIO Bank4 Pin 15 high. + */ +static void enable_vbus(void) +{ + u32 value; + + /* configure GPIO bank4 pin 15 in output direction */ + value = readl(davinci_gpio_bank45-dir); + writel((value (~DA8XX_USB_VBUS_GPIO)), davinci_gpio_bank45-dir); + + /* set GPIO bank4 pin 15 high to drive VBUS */ + value = readl(davinci_gpio_bank45-set_data); + writel((value | DA8XX_USB_VBUS_GPIO), davinci_gpio_bank45-set_data); +} + +/* + * Enable the usb0 phy. This initialization procedure is explained in + * the DA8xx USB user guide document. + */ +static u8 phy_on(void) +{ + u32 timeout; + u32 cfgchip2; + + cfgchip2 = readl(davinci_syscfg_regs-cfgchip2); + + cfgchip2 = ~(CFGCHIP2_RESET | CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN | + CFGCHIP2_OTGMODE | CFGCHIP2_REFFREQ); + cfgchip2 |= CFGCHIP2_SESENDEN | CFGCHIP2_VBDTCTEN | CFGCHIP2_PHY_PLLON | + CFGCHIP2_REFFREQ_24MHZ; + + writel(cfgchip2, davinci_syscfg_regs-cfgchip2); + + /* wait until the usb phy pll locks */ + timeout = musb_cfg.timeout; + while (timeout--) + if (readl(davinci_syscfg_regs-cfgchip2) CFGCHIP2_PHYCLKGD) + return 1; + + /* USB phy was not turned on */ + return 0; +} + +/* + * Disable the usb phy + */ +static void phy_off(void) +{ + u32 cfgchip2; + + /* +* Power down the on-chip PHY. +*/ + cfgchip2 = readl(davinci_syscfg_regs-cfgchip2); + cfgchip2 = ~CFGCHIP2_PHY_PLLON; + cfgchip2 |= CFGCHIP2_PHYPWRDN | CFGCHIP2_OTGPWRDN; + writel(cfgchip2, davinci_syscfg_regs-cfgchip2); +} + +/* + * This function performs DA8xx platform specific initialization for usb0. + */ +int musb_platform_init(void) +{ + u32 revision; + + /* enable psc for usb2.0 */ + lpsc_on(33); + + /* enable usb vbus */ + enable_vbus(); + + /* reset the controller */ + writel(0x1, da8xx_usb_regs-control); + udelay(5000); + + /* start the on-chip usb phy and its pll */ + if (phy_on() == 0) + return -1; + + /* Returns zero if e.g. not clocked */ + revision = readl(da8xx_usb_regs-revision); + if (revision == 0) + return -1; + + /* Disable all interrupts */ + writel((DA8XX_USB_USBINT_MASK | DA8XX_USB_TXINT_MASK | + DA8XX_USB_RXINT_MASK), da8xx_usb_regs-intmsk_set); + return 0; +} + +/* + * This function performs DA8xx platform specific deinitialization for usb0. + */ +void musb_platform_deinit(void) +{ + /* Turn of the phy */ + phy_off(); + + /* flush any interrupts */ +
Re: [U-Boot] [PATCH] smc911x: fix typo in smc911x_handle_mac_address name
Ben, Any chance this one can be merged as well? Mike Rapoport wrote: Signed-off-by: Mike Rapoport m...@compulab.co.il --- drivers/net/smc911x.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index c50758e..acc2306 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c @@ -37,7 +37,7 @@ void pkt_data_push(struct eth_device *dev, u32 addr, u32 val) \ #define mdelay(n) udelay((n)*1000) -static void smx911x_handle_mac_address(struct eth_device *dev) +static void smc911x_handle_mac_address(struct eth_device *dev) { unsigned long addrh, addrl; uchar *m = dev-enetaddr; @@ -155,7 +155,7 @@ static int smc911x_init(struct eth_device *dev, bd_t * bd) /* Configure the PHY, initialize the link state */ smc911x_phy_configure(dev); - smx911x_handle_mac_address(dev); + smc911x_handle_mac_address(dev); /* Turn on Tx + Rx */ smc911x_enable(dev); -- Sincerely yours, Mike. ___ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot
[U-Boot] [PATCHi v3] OMAP3: add CM-T35 board
Add CM-T35 board support Signed-off-by: Mike Rapoport m...@compulab.co.il -- v2 changes: - rename board config file from omap3_cm-t35.h to cm-t35.h - remove SZ_xx references - add MAKEALL/MAINTEINERS entries v3 changes: - fix whitespace and indentation - remove eth_init from board_eth_init - add CM-T35 entry to doc/README.omap3 - fixed board name in MAINTAINERS --- MAINTAINERS |4 + MAKEALL |1 + Makefile |2 + board/cm-t35/Makefile| 47 board/cm-t35/cm-t35.c| 190 + board/cm-t35/cm-t35.h| 173 +++ board/cm-t35/config.mk | 30 + doc/README.omap3 | 16 ++- include/configs/cm-t35.h | 296 ++ 9 files changed, 757 insertions(+), 2 deletions(-) create mode 100644 board/cm-t35/Makefile create mode 100644 board/cm-t35/cm-t35.c create mode 100644 board/cm-t35/cm-t35.h create mode 100644 board/cm-t35/config.mk create mode 100644 include/configs/cm-t35.h diff --git a/MAINTAINERS b/MAINTAINERS index d70a9d2..49b2164 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -677,6 +677,10 @@ Stelian Pop stelian@leadtechdesign.com at91sam9263ek ARM926EJS (AT91SAM9263 SoC) at91sam9rlekARM926EJS (AT91SAM9RL SoC) +Mike Rapoport m...@compulab.co.il + + cm-t35 ARM CORTEX-A8 (OMAP3xx SoC) + Tom Rix tom@windriver.com omap3_zoom2 ARM CORTEX-A8 (OMAP3xx SoC) diff --git a/MAKEALL b/MAKEALL index d63c5c2..6f90ad5 100755 --- a/MAKEALL +++ b/MAKEALL @@ -612,6 +612,7 @@ LIST_ARM11=\ ## ARM Cortex-A8 Systems # LIST_ARM_CORTEX_A8= \ + cm-t35 \ devkit8000 \ omap3_beagle\ omap3_overo \ diff --git a/Makefile b/Makefile index bcb3fe9..24c9418 100644 --- a/Makefile +++ b/Makefile @@ -3143,6 +3143,8 @@ SMN42_config : unconfig # ## ARM CORTEX Systems # +cm-t35_config :unconfig + @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 cm-t35 NULL omap3 devkit8000_config :unconfig @$(MKCONFIG) $(@:_config=) arm arm_cortexa8 devkit8000 timll omap3 diff --git a/board/cm-t35/Makefile b/board/cm-t35/Makefile new file mode 100644 index 000..7b80aaa --- /dev/null +++ b/board/cm-t35/Makefile @@ -0,0 +1,47 @@ +# +# (C) Copyright 2000, 2001, 2002 +# 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 := cm-t35.o + +SRCS := $(COBJS:.o=.c) +OBJS := $(addprefix $(obj),$(COBJS)) + +$(LIB):$(obj).depend $(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +clean: + rm -f $(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/cm-t35/cm-t35.c b/board/cm-t35/cm-t35.c new file mode 100644 index 000..40488a2 --- /dev/null +++ b/board/cm-t35/cm-t35.c @@ -0,0 +1,190 @@ +/* + * (C) Copyright 2009 + * CompuLab, Ltd. www.compulab.co.il + * + * Authors : + * Igor Vaisbein i...@compulab.co.il + * Mike Rapoport m...@compulab.co.il + * + * Derived from omap3evm and Beagle Board by + * Manikandan Pillai mani.pil...@ti.com + * Richard Woodruff r-woodru...@ti.com + * Syed Mohammed Khasim x0kha...@ti.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
[U-Boot] [PATCH V2 1/3 CORRECTED] Initial support for Marvell Orion5x SoC
** ATTENTION: this patch supersedes the previous '1/3' patch in the same series. The correction is the removal of Kirkwood-inherited device init code unused at the moment and partly inapplicable to Orion5x anyway. This correct patch has been run through checkpatch.pl again with the exact same result as its predecessor (6 false pos). Sorry for the inconvenience. This patch adds support for the Marvell Orion5x SoC. It has no use alone, and must be followed by a patch to add Orion5x support for serial, then support for the ED Mini V2, an Orion5x-based board from LaCie. Signed-off-by: Albert Aribaud albert.arib...@free.fr --- cpu/arm926ejs/orion5x/Makefile | 52 ++ cpu/arm926ejs/orion5x/cpu.c| 299 cpu/arm926ejs/orion5x/dram.c | 61 +++ cpu/arm926ejs/orion5x/mpp.c| 89 ++ cpu/arm926ejs/orion5x/timer.c | 175 +++ include/asm-arm/arch-orion5x/88f5182.h | 40 + include/asm-arm/arch-orion5x/cpu.h | 208 ++ include/asm-arm/arch-orion5x/gpio.h| 52 ++ include/asm-arm/arch-orion5x/mpp.h | 122 + include/asm-arm/arch-orion5x/orion5x.h | 67 +++ 10 files changed, 1165 insertions(+), 0 deletions(-) create mode 100644 cpu/arm926ejs/orion5x/Makefile create mode 100644 cpu/arm926ejs/orion5x/cpu.c create mode 100644 cpu/arm926ejs/orion5x/dram.c create mode 100644 cpu/arm926ejs/orion5x/mpp.c create mode 100644 cpu/arm926ejs/orion5x/timer.c create mode 100644 include/asm-arm/arch-orion5x/88f5182.h create mode 100644 include/asm-arm/arch-orion5x/cpu.h create mode 100644 include/asm-arm/arch-orion5x/gpio.h create mode 100644 include/asm-arm/arch-orion5x/mpp.h create mode 100644 include/asm-arm/arch-orion5x/orion5x.h diff --git a/cpu/arm926ejs/orion5x/Makefile b/cpu/arm926ejs/orion5x/Makefile new file mode 100644 index 000..3343124 --- /dev/null +++ b/cpu/arm926ejs/orion5x/Makefile @@ -0,0 +1,52 @@ +# +# Copyright (C) 2009 Albert ARIBAUD albrt.arib...@free.fr +# +# Based on original Kirkwood support which is +# (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 +# + +include $(TOPDIR)/config.mk + +LIB= $(obj)lib$(SOC).a + +COBJS-y= cpu.o +COBJS-y+= dram.o +COBJS-y+= mpp.o +COBJS-y+= timer.o + +SRCS := $(SOBJS:.o=.S) $(COBJS-y:.o=.c) +OBJS := $(addprefix $(obj),$(SOBJS) $(COBJS-y)) + +all: $(obj).depend $(LIB) + +$(LIB):$(OBJS) + $(AR) $(ARFLAGS) $@ $(OBJS) + +# + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend + +# diff --git a/cpu/arm926ejs/orion5x/cpu.c b/cpu/arm926ejs/orion5x/cpu.c new file mode 100644 index 000..f4644b1 --- /dev/null +++ b/cpu/arm926ejs/orion5x/cpu.c @@ -0,0 +1,299 @@ +/* + * Copyright (C) 2009 Albert ARIBAUD albert.arib...@free.fr + * + * Based on original Kirkwood support which is + * (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 + */ + +#include common.h +#include netdev.h +#include asm/cache.h +#include u-boot/md5.h +#include asm/arch/orion5x.h