[U-Boot] [PATCH v3] arm926ejs: add NXP LPC32x0 cpu series support

2011-10-18 Thread Vladimir Zapolskiy
This change adds initial support for NXP LPC32x0 SoC series.

Signed-off-by: Vladimir Zapolskiy 
---
Changes from v2 to v3:
* checkpatch.pl reports zero errors and warnings

Changes from v1 to v2:
* BIT(n) and SBF(s, v) macro are not used anymore
* removed NS16550 and 14-clock UART definitions from uart.h
* added devices.c file, which contains standard UART preinitialization routine
* added get_serial_clock() function, it returns actual frequency of UART clock
* __udelay() realization is simplified, no need of interrupt handling

 arch/arm/cpu/arm926ejs/lpc32xx/Makefile|   45 
 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c|  101 ++
 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c   |   46 
 arch/arm/cpu/arm926ejs/lpc32xx/devices.c   |   47 +
 arch/arm/cpu/arm926ejs/lpc32xx/timer.c |   94 +
 arch/arm/include/asm/arch-lpc32xx/clk.h|  155 
 arch/arm/include/asm/arch-lpc32xx/config.h |   50 +
 arch/arm/include/asm/arch-lpc32xx/cpu.h|   62 +++
 arch/arm/include/asm/arch-lpc32xx/timer.h  |   74 +
 arch/arm/include/asm/arch-lpc32xx/uart.h   |   54 ++
 arch/arm/include/asm/arch-lpc32xx/wdt.h|   51 +
 11 files changed, 779 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/Makefile
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/cpu.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/devices.c
 create mode 100644 arch/arm/cpu/arm926ejs/lpc32xx/timer.c
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/clk.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/config.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/cpu.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/timer.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/uart.h
 create mode 100644 arch/arm/include/asm/arch-lpc32xx/wdt.h

diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/Makefile 
b/arch/arm/cpu/arm926ejs/lpc32xx/Makefile
new file mode 100644
index 000..29b4dc8
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/Makefile
@@ -0,0 +1,45 @@
+#
+# (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$(SOC).o
+
+COBJS   = cpu.o clkpwr.o devices.o timer.o
+
+SRCS:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+
+all:$(obj).depend $(LIB)
+
+$(LIB): $(OBJS)
+   $(call cmd_link_o_target, $(OBJS))
+
+#
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#
diff --git a/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c 
b/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
new file mode 100644
index 000..adae8b0
--- /dev/null
+++ b/arch/arm/cpu/arm926ejs/lpc32xx/clkpwr.c
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2011 by Vladimir Zapolskiy 
+ *
+ * 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 
+#include 
+#include 
+#include 
+#include 
+
+static struct clk_t *clk = (struct clk_t *)CLK_PM_BASE;
+
+unsigned int get_sys_clk_rate(void)
+{
+   if (readl(&clk->sysclk_ctrl) & CLK_SYSCLK_PLL397)
+   return RTC_CLK_FREQUENCY * 397;
+   else
+   return OSC_CLK_FREQUENCY;
+}
+
+unsigned int get_hclk_pll_rate(void)
+{
+   unsign

Re: [U-Boot] [PATCH v3] arm926ejs: add NXP LPC32x0 cpu series support

2011-10-31 Thread Albert ARIBAUD
Hi Vladimir,

Le 24/10/2011 01:04, Vladimir Zapolskiy a écrit :
> Hi Albert,
>
> On 22.10.2011 02:31, Albert ARIBAUD wrote:
>> Hi Vladimir,
>>
>> Le 18/10/2011 17:55, Vladimir Zapolskiy a écrit :
>>> This change adds initial support for NXP LPC32x0 SoC series.
>>>
>>> Signed-off-by: Vladimir Zapolskiy
>>> ---
>>> Changes from v2 to v3:
>>> * checkpatch.pl reports zero errors and warnings
>>>
>>> Changes from v1 to v2:
>>> * BIT(n) and SBF(s, v) macro are not used anymore
>>> * removed NS16550 and 14-clock UART definitions from uart.h
>>> * added devices.c file, which contains standard UART preinitialization
>>> routine
>>> * added get_serial_clock() function, it returns actual frequency of
>>> UART clock
>>> * __udelay() realization is simplified, no need of interrupt handling
>>
>> As it stands, this is dead code until some board uses it; I imagine you
>> have board waiting for this support. Can you submit the SoC and board
>> code as a patch set? This way, it will be obvious for all that the SoC
>> code in this patch has actual use.
>
> you're right, I have a board to make support for. However I presume that
> U-boot maintainers won't be happy to include a board with
> CONFIG_ENV_IS_NOWHERE, and unfortunately flash driver isn't yet ready
> for publishing.

CONFIG_ENV_IS_NOWHERE is the board( maintainer)'s business.

Ditto for the FLASH driver, if it is not required for use of the board 
(e.g., if U-Boot can fire up and does not need the FLASH to boot an OS, 
then a broken FLASH driver is an inconvenience, not a showstopper).

> I'd like to get an advice, if you think that weakly supported but
> working U-boot on the board has chances to be included to arm-next I can
> send the patchset right now for review, otherwise I'll spend some time
> (one week approximately) to finish NAND driver.

IMO, the acceptable state of a board is the board maintainer's affair, 
with a bare minimum that U-Boot must be able to play its role as a 
bootloader.

Anyway, since that is for next, not master, and since you think you can 
add the missing support far before the next merge window, I suggest you 
complete board support and add it to V4.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm926ejs: add NXP LPC32x0 cpu series support

2011-10-31 Thread Vladimir Zapolskiy
Hi Albert,

On 31.10.2011 19:42, Albert ARIBAUD wrote:
> Hi Vladimir,
>
> Le 24/10/2011 01:04, Vladimir Zapolskiy a écrit :
>> Hi Albert,
>>
>> On 22.10.2011 02:31, Albert ARIBAUD wrote:
>>> Hi Vladimir,
>>>
>>> Le 18/10/2011 17:55, Vladimir Zapolskiy a écrit :
 This change adds initial support for NXP LPC32x0 SoC series.

 Signed-off-by: Vladimir Zapolskiy
 ---
 Changes from v2 to v3:
 * checkpatch.pl reports zero errors and warnings

 Changes from v1 to v2:
 * BIT(n) and SBF(s, v) macro are not used anymore
 * removed NS16550 and 14-clock UART definitions from uart.h
 * added devices.c file, which contains standard UART preinitialization
 routine
 * added get_serial_clock() function, it returns actual frequency of
 UART clock
 * __udelay() realization is simplified, no need of interrupt handling
>>>
>>> As it stands, this is dead code until some board uses it; I imagine you
>>> have board waiting for this support. Can you submit the SoC and board
>>> code as a patch set? This way, it will be obvious for all that the SoC
>>> code in this patch has actual use.
>>
>> you're right, I have a board to make support for. However I presume that
>> U-boot maintainers won't be happy to include a board with
>> CONFIG_ENV_IS_NOWHERE, and unfortunately flash driver isn't yet ready
>> for publishing.
>
> CONFIG_ENV_IS_NOWHERE is the board( maintainer)'s business.
 >
> Ditto for the FLASH driver, if it is not required for use of the board
> (e.g., if U-Boot can fire up and does not need the FLASH to boot an OS,
> then a broken FLASH driver is an inconvenience, not a showstopper).

I've added CFI flash support to the board, however the environment is 
supposed to be stored in NAND flash, and that requires some more LPC32XX 
specific stuff to be developed for U-boot soon (basically that's NAND 
controller and DMA drivers).

>> I'd like to get an advice, if you think that weakly supported but
>> working U-boot on the board has chances to be included to arm-next I can
>> send the patchset right now for review, otherwise I'll spend some time
>> (one week approximately) to finish NAND driver.
>
> IMO, the acceptable state of a board is the board maintainer's affair,
> with a bare minimum that U-Boot must be able to play its role as a
> bootloader.
>
It's done in my understanding. Hopefully some more addons still should 
be implemented, and I'd like to concentrate on them being assured that 
the SoC and basic board support are pulled in.

> Anyway, since that is for next, not master, and since you think you can
> add the missing support far before the next merge window, I suggest you
> complete board support and add it to V4.
>

The initial board support was done and published a week ago, please 
check http://lists.denx.de/pipermail/u-boot/2011-October/106991.html

And that's my expression of willing to become a board maintainer, sorry 
it hasn't been included to the board changeset originally - 
http://lists.denx.de/pipermail/u-boot/2011-October/107069.html

I'd like to encourage you to check that the board specific compilation 
has zero warnings and checkpatch.pl output is clean.

-- 
With best wishes,
Vladimir
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm926ejs: add NXP LPC32x0 cpu series support

2011-10-21 Thread Albert ARIBAUD
Hi Vladimir,

Le 18/10/2011 17:55, Vladimir Zapolskiy a écrit :
> This change adds initial support for NXP LPC32x0 SoC series.
>
> Signed-off-by: Vladimir Zapolskiy
> ---
> Changes from v2 to v3:
> * checkpatch.pl reports zero errors and warnings
>
> Changes from v1 to v2:
> * BIT(n) and SBF(s, v) macro are not used anymore
> * removed NS16550 and 14-clock UART definitions from uart.h
> * added devices.c file, which contains standard UART preinitialization routine
> * added get_serial_clock() function, it returns actual frequency of UART clock
> * __udelay() realization is simplified, no need of interrupt handling

As it stands, this is dead code until some board uses it; I imagine you 
have board waiting for this support. Can you submit the SoC and board 
code as a patch set? This way, it will be obvious for all that the SoC 
code in this patch has actual use.

Amicalement,
-- 
Albert.
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm926ejs: add NXP LPC32x0 cpu series support

2011-10-23 Thread Vladimir Zapolskiy
Hi Albert,

On 22.10.2011 02:31, Albert ARIBAUD wrote:
> Hi Vladimir,
>
> Le 18/10/2011 17:55, Vladimir Zapolskiy a écrit :
>> This change adds initial support for NXP LPC32x0 SoC series.
>>
>> Signed-off-by: Vladimir Zapolskiy
>> ---
>> Changes from v2 to v3:
>> * checkpatch.pl reports zero errors and warnings
>>
>> Changes from v1 to v2:
>> * BIT(n) and SBF(s, v) macro are not used anymore
>> * removed NS16550 and 14-clock UART definitions from uart.h
>> * added devices.c file, which contains standard UART preinitialization
>> routine
>> * added get_serial_clock() function, it returns actual frequency of
>> UART clock
>> * __udelay() realization is simplified, no need of interrupt handling
>
> As it stands, this is dead code until some board uses it; I imagine you
> have board waiting for this support. Can you submit the SoC and board
> code as a patch set? This way, it will be obvious for all that the SoC
> code in this patch has actual use.

you're right, I have a board to make support for. However I presume that 
U-boot maintainers won't be happy to include a board with 
CONFIG_ENV_IS_NOWHERE, and unfortunately flash driver isn't yet ready 
for publishing.

I'd like to get an advice, if you think that weakly supported but 
working U-boot on the board has chances to be included to arm-next I can 
send the patchset right now for review, otherwise I'll spend some time 
(one week approximately) to finish NAND driver.

-- 
With best wishes,
Vladimir
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] arm926ejs: add NXP LPC32x0 cpu series support

2011-10-23 Thread Wolfgang Denk
Dear Vladimir Zapolskiy,

In message <4ea49d8e.2050...@mleia.com> you wrote:
> 
> you're right, I have a board to make support for. However I presume that >
> U-boot maintainers won't be happy to include a board with >
> CONFIG_ENV_IS_NOWHERE, and unfortunately flash driver isn't yet ready >

Why not?  There are other boards with CONFIG_ENV_IS_NOWHERE :

-> grep CONFIG_ENV_IS_NOWHERE include/configs/* | wc -l
68

> I'd like to get an advice, if you think that weakly supported but >
> working U-boot on the board has chances to be included to arm-next I can >
> send the patchset right now for review, otherwise I'll spend some time >
> (one week approximately) to finish NAND driver.

Release early, release often.

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
Intel's new motto: United we stand. Divided we fall!
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot