Skip to contentSkip to conversation

ARM: Add support for EP93XX SoCs

PATCH New Matthias Kaehlcke 2 participants 4 messages Dec 23, 2009 – Jan 17, 2010 Arm/actions semi architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ARM: Add support for EP93XX SoCs

Add support for the Cirrus EP93XX platform

---
 cpu/arm920t/ep93xx/Makefile          |   56 ++++
 cpu/arm920t/ep93xx/cpu.c             |   51 +++
 cpu/arm920t/ep93xx/led.c             |   63 ++++
 cpu/arm920t/ep93xx/led.h             |   26 ++
 cpu/arm920t/ep93xx/lowlevel_init.S   |   65 ++++
 cpu/arm920t/ep93xx/speed.c           |  109 ++++++
 cpu/arm920t/ep93xx/timer.c           |  157 +++++++++
 cpu/arm920t/ep93xx/u-boot.lds        |   59 ++++
 include/asm-arm/arch-ep93xx/ep93xx.h |  596 ++++++++++++++++++++++++++++++++++
 9 files changed, 1182 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm920t/ep93xx/Makefile
 create mode 100644 cpu/arm920t/ep93xx/cpu.c
 create mode 100644 cpu/arm920t/ep93xx/led.c
 create mode 100644 cpu/arm920t/ep93xx/led.h
 create mode 100644 cpu/arm920t/ep93xx/lowlevel_init.S
 create mode 100644 cpu/arm920t/ep93xx/speed.c
 create mode 100644 cpu/arm920t/ep93xx/timer.c
 create mode 100644 cpu/arm920t/ep93xx/u-boot.lds
 create mode 100644 include/asm-arm/arch-ep93xx/ep93xx.h
cpu/arm920t/ep93xx/Makefile new file +56 -0
new file mode 100644
index 0000000..30e12af
@@ -0,0 +1,56 @@
+#
+# Cirrus Logic EP93xx CPU-specific Makefile
+#
+# Copyright (C) 2009 Matthias Kaehlcke <[email protected]>
+#
+# Copyright (C) 2004, 2005
+# Cory T. Tusar, Videon Central, Inc., <[email protected]>
+#
+# Copyright (C) 2006
+# Dominic Rath <[email protected]>
+#
+# Based on an original Makefile, which is
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd at 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.,
+# 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+include $(TOPDIR)/config.mk
+
+LIB = $(obj)lib$(SOC).a
+
+COBJS   = cpu.o led.o speed.o timer.o
+SOBJS   = lowlevel_init.o
+
+SRCS    := $(SOBJS:.o=.S) $(COBJS:.o=.c)
+OBJS    := $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+all:    $(obj).depend $(LIB)
+
+$(LIB): $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
+
cpu/arm920t/ep93xx/cpu.c new file +51 -0

51 lines not on this page · raw message

cpu/arm920t/ep93xx/led.c new file +63 -0

63 lines not on this page · raw message

cpu/arm920t/ep93xx/led.h new file +26 -0
new file mode 100644
index 0000000..db9512f
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2009 Matthias Kaehlcke <[email protected]>
+ *
+ * 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
+ */
+
+extern void red_LED_on(void);
+extern void red_LED_off(void);
+extern void green_LED_on(void);
+extern void green_LED_off(void);
cpu/arm920t/ep93xx/lowlevel_init.S new file +65 -0

65 lines not on this page · raw message

cpu/arm920t/ep93xx/speed.c new file +109 -0

109 lines not on this page · raw message

cpu/arm920t/ep93xx/timer.c new file +157 -0

157 lines not on this page · raw message

cpu/arm920t/ep93xx/u-boot.lds new file +59 -0

59 lines not on this page · raw message

include/asm-arm/arch-ep93xx/ep93xx.h new file +596 -0

596 lines not on this page · raw message

Signature · 1 line
1.6.3.1
#1 lore raw

PATCH 1/3 ARM: Add support for EP93XX SoCs

Quoted 15 lines · Matthias Kaehlcke

Add support for the Cirrus EP93XX platform

---
 cpu/arm920t/ep93xx/Makefile          |   56 ++++
 cpu/arm920t/ep93xx/cpu.c             |   51 +++
 cpu/arm920t/ep93xx/led.c             |   63 ++++
 cpu/arm920t/ep93xx/led.h             |   26 ++
 cpu/arm920t/ep93xx/lowlevel_init.S   |   65 ++++
 cpu/arm920t/ep93xx/speed.c           |  109 ++++++
 cpu/arm920t/ep93xx/timer.c           |  157 +++++++++
 cpu/arm920t/ep93xx/u-boot.lds        |   59 ++++
 include/asm-arm/arch-ep93xx/ep93xx.h |  596 ++++++++++++++++++++++++++++++++++
 9 files changed, 1182 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm920t/ep93xx/Makefile
Quoted 8 lines
 create mode 100644 cpu/arm920t/ep93xx/cpu.c
 create mode 100644 cpu/arm920t/ep93xx/led.c
 create mode 100644 cpu/arm920t/ep93xx/led.h
 create mode 100644 cpu/arm920t/ep93xx/lowlevel_init.S
 create mode 100644 cpu/arm920t/ep93xx/speed.c
 create mode 100644 cpu/arm920t/ep93xx/timer.c
 create mode 100644 cpu/arm920t/ep93xx/u-boot.lds
 create mode 100644 include/asm-arm/arch-ep93xx/ep93xx.h

There are build errors that cut this review short. The review of this patch is fairly complete. I will review the others on the next revision.

For the ep93xx boards, I saw this error on MAKEALL and building normally

src/u-boot-arm/drivers/net/ep93xx.c:513: undefined reference to unlikely' drivers/net/libnet.a(ep93xx.o): In function ep93xx_miiphy_write'

On regression testing with
MAKEALL arm

There are multiple new warnings about 'ERROR' being redefined /u-boot-arm/include/dataflash.h:160:1: warning: "ERROR" redefined In file included from at45.c:22:

Quoted 8 lines
cpu/arm920t/ep93xx/Makefile new file +1 -0
new file mode 100644
index 0000000..30e12af
@@ -0,0 +1,56 @@
+#

<snip>

cpu/arm920t/ep93xx/Makefile

Quoted 11 lines

+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */

cpu/arm920t/ep93xx/Makefile new file +8 -0
+
+#include <asm/io.h>
+#include <asm/arch/ep93xx.h>
+
+#define GREEN_LED_POS		0x01
+#define RED_LED_POS		0x02
+
+

ws
remove extra space

Quoted 12 lines
cpu/arm920t/ep93xx/Makefile new file +12 -0
+inline void switch_LED_on(uint32_t bit_pos)
+{
+	register struct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE;
+
+	writel(readl(&gpio->pedr) | bit_pos, &gpio->pedr);
+
+}
+
+inline void switch_LED_off(uint32_t bit_pos)
+{
+	register struct gpio_regs *gpio = (struct gpio_regs *)GPIO_BASE;
+

<snip>

cpu/arm920t/ep93xx/Makefile

Quoted 12 lines

+ * 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
+ */

cpu/arm920t/ep93xx/Makefile new file +5 -0
+
+extern void red_LED_on(void);
+extern void red_LED_off(void);
+extern void green_LED_on(void);
+extern void green_LED_off(void);

These are defined in include/status_led.h
Please use these and insure that your led implementation is complaint with status_led.h

Quoted 10 lines
cpu/arm920t/ep93xx/lowlevel_init.S new file +4 -0
new file mode 100644
index 0000000..a20ec89
@@ -0,0 +1,65 @@
+/*
+ * Low-level initialization for EP93xx
+ *
+ * Copyright (C) 2009 Matthias Kaehlcke <[email protected]>

<snip>

Quoted 10 lines

index 0000000..7e0c26d

cpu/arm920t/ep93xx/speed.c new file +6 -0
@@ -0,0 +1,109 @@
+/*
+ * Cirrus Logic EP93xx PLL support.
+ *
+ * Copyright (C) 2009 Matthias Kaehlcke <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this project.

cpu/arm920t/ep93xx/speed.c line 16

Quoted 10 lines
cpu/arm920t/ep93xx/speed.c new file +10 -0
+ *
+ * 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.

ws
remove tab after PURPOSE.

Quoted 10 lines
cpu/arm920t/ep93xx/speed.c new file +10 -0
+ *
+ * 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 <asm/arch/ep93xx.h>
+#include <asm/io.h>
+#include <div64.h>
+

cpu/arm920t/ep93xx/speed.c line 36

Quoted 10 lines
cpu/arm920t/ep93xx/speed.c new file +10 -0
+/*
+ * NOTE: This describes the proper use of this file.
+ *
+ * CONFIG_SYS_CLK_FREQ should be defined as the input frequency of the PLL.
+ *
+ * get_FCLK(), get_HCLK(), get_PCLK() and get_UCLK() return the clock of
+ * the specified bus in HZ.
+ */
+
+static char fclk_divisors[] = { 1, 2, 4, 8, 16, 1, 1, 1 };

This is only used in get_FCLK()
The definition should move there.
Also the type in get_FLCK is uint8_t.
The type of the table could be improbed to be uint8_t

cpu/arm920t/ep93xx/speed.c line 37

Quoted 1 line
cpu/arm920t/ep93xx/speed.c new file +1 -0
+static char hclk_divisors[] = { 1, 2, 4, 5, 6, 8, 16, 32 };

Similar.

Quoted 7 lines
cpu/arm920t/ep93xx/speed.c new file +5 -0
+static char pclk_divisors[] = { 1, 2, 4, 8 };
 
 
+
+/*
+ * return the PLL output frequency
+ *

<snip>

Quoted 23 lines
cpu/arm920t/ep93xx/speed.c new file +2 -0
+	return CONFIG_SYS_HZ;
+}
cpu/arm920t/ep93xx/u-boot.lds new file +15 -0
new file mode 100644
index 0000000..76caef3
@@ -0,0 +1,59 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <[email protected]>
+ *
+ * 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

cpu/arm920t/ep93xx/u-boot.lds line 25

Quoted 10 lines
cpu/arm920t/ep93xx/u-boot.lds new file +10 -0
+ * 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
+ */
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+/*OUTPUT_FORMAT("elf32-arm", "elf32-arm", "elf32-arm")*/

Remove if not needed

Quoted 4 lines
cpu/arm920t/ep93xx/u-boot.lds new file +4 -0
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{

cpu/arm920t/ep93xx/u-boot.lds line 39

Quoted 10 lines
cpu/arm920t/ep93xx/u-boot.lds new file +10 -0
+	. = 0x00000000;
+
+	. = ALIGN(4);
+	.text      :
+	{
+	  cpu/arm920t/start.o	(.text)
+	  . = 0x1000;
+	  LONG(0x53555243)
+	  *(.text)
+	}

Please add a comment on this magic number
+ LONG(0x53555243)
And on the offset 0x1000

Quoted 46 lines
cpu/arm920t/ep93xx/u-boot.lds new file +20 -0
+
+	. = ALIGN(4);
+	.rodata : { *(.rodata) }
+
+	. = ALIGN(4);
+	.data : { *(.data) }
+
+	. = ALIGN(4);
+	.got : { *(.got) }
+
+	. = .;
+	__u_boot_cmd_start = .;
+	.u_boot_cmd : { *(.u_boot_cmd) }
+	__u_boot_cmd_end = .;
+
+	. = ALIGN(4);
+	__bss_start = .;
+	.bss : { *(.bss) }
+	_end = .;
+}
include/asm-arm/arch-ep93xx/ep93xx.h new file +20 -0
new file mode 100644
index 0000000..74c79f6
@@ -0,0 +1,596 @@
+/* -----------------------------------------------------------------------------
+ * Cirrus Logic EP93xx register definitions.
+ *
+ * Copyright (C) 2009
+ * Matthias Kaehlcke <[email protected]>
+ *
+ * Copyright (C) 2006
+ * Dominic Rath <[email protected]>
+ *
+ * Copyright (C) 2004, 2005
+ * Cory T. Tusar, Videon Central, Inc., <[email protected]>
+ *
+ * Based in large part on linux/include/asm-arm/arch-ep93xx/regmap.h, which is
+ *
+ * Copyright (C) 2004 Ray Lehtiniemi
+ * Copyright (C) 2003 Cirrus Logic, Inc
+ * Copyright (C) 1999 ARM Limited.
+ *
+ * See file CREDITS for list of people who contributed to this project.
+ *

include/asm-arm/arch-ep93xx/ep93xx.h line 30

Quoted 10 lines
include/asm-arm/arch-ep93xx/ep93xx.h new file +10 -0
+ * 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.
+ *

ws
remove tab after PURPOSE.

include/asm-arm/arch-ep93xx/ep93xx.h line 34

Quoted 4 lines
include/asm-arm/arch-ep93xx/ep93xx.h new file +4 -0
+ * 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.
+ */

Tom

#2 lore raw

PATCH 1/3 ARM: Add support for EP93XX SoCs

hi tom,

thanks for your review!

El Sun, Jan 17, 2010 at 09:25:52AM -0600 Tom ha dit:

Quoted 25 lines
Quoted 15 lines · Matthias Kaehlcke

Add support for the Cirrus EP93XX platform

---
 cpu/arm920t/ep93xx/Makefile          |   56 ++++
 cpu/arm920t/ep93xx/cpu.c             |   51 +++
 cpu/arm920t/ep93xx/led.c             |   63 ++++
 cpu/arm920t/ep93xx/led.h             |   26 ++
 cpu/arm920t/ep93xx/lowlevel_init.S   |   65 ++++
 cpu/arm920t/ep93xx/speed.c           |  109 ++++++
 cpu/arm920t/ep93xx/timer.c           |  157 +++++++++
 cpu/arm920t/ep93xx/u-boot.lds        |   59 ++++
 include/asm-arm/arch-ep93xx/ep93xx.h |  596 ++++++++++++++++++++++++++++++++++
 9 files changed, 1182 insertions(+), 0 deletions(-)
 create mode 100644 cpu/arm920t/ep93xx/Makefile
Quoted 8 lines
 create mode 100644 cpu/arm920t/ep93xx/cpu.c
 create mode 100644 cpu/arm920t/ep93xx/led.c
 create mode 100644 cpu/arm920t/ep93xx/led.h
 create mode 100644 cpu/arm920t/ep93xx/lowlevel_init.S
 create mode 100644 cpu/arm920t/ep93xx/speed.c
 create mode 100644 cpu/arm920t/ep93xx/timer.c
 create mode 100644 cpu/arm920t/ep93xx/u-boot.lds
 create mode 100644 include/asm-arm/arch-ep93xx/ep93xx.h
Quoted 8 lines

There are build errors that cut this review short. The review of this patch is fairly complete. I will review the others on the next revision.

For the ep93xx boards, I saw this error on MAKEALL and building normally

src/u-boot-arm/drivers/net/ep93xx.c:513: undefined reference to unlikely' drivers/net/libnet.a(ep93xx.o): In function ep93xx_miiphy_write'

i forgot that i have an additional patch in my tree that fixes this issue

as it isn't related with ep93xx in any way i sent it separately:

http://lists.denx.de/pipermail/u-boot/2009-December/065779.html

what is the right way to solve this dependency on a patch that isn't in mainline yet? add it to the patch set though it isn't ep93xx related?

i'll comment/resolve the other issues you raised at a later point

Signature · 10 lines
Matthias Kaehlcke
Embedded Linux Developer
Barcelona

            Nothing is more despicable than respect based on fear
                              (Albert Camus)
                                                                 .''`.
    using free software / Debian GNU/Linux | http://debian.org  : :'  :
                                                                `. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4                  `-
#3 lore raw

PATCH 1/3 ARM: Add support for EP93XX SoCs

Quoted 9 lines · Matthias Kaehlcke

hi tom,

thanks for your review!

El Sun, Jan 17, 2010 at 09:25:52AM -0600 Tom ha dit:

Quoted 3 lines
Quoted 2 lines · Matthias Kaehlcke

Add support for the Cirrus EP93XX platform

<snip>

Quoted 10 lines
Quoted 9 lines
Quoted 1 line
 create mode 100644 include/asm-arm/arch-ep93xx/ep93xx.h

There are build errors that cut this review short. The review of this patch is fairly complete. I will review the others on the next revision.

For the ep93xx boards, I saw this error on MAKEALL and building normally

src/u-boot-arm/drivers/net/ep93xx.c:513: undefined reference to unlikely' drivers/net/libnet.a(ep93xx.o): In function ep93xx_miiphy_write'

Quoted 7 lines

i forgot that i have an additional patch in my tree that fixes this issue

as it isn't related with ep93xx in any way i sent it separately:

http://lists.denx.de/pipermail/u-boot/2009-December/065779.html

I verified that unlikely/likely are defined in linux/compiler.h As recommended by Mike F.

Quoted 4 lines

what is the right way to solve this dependency on a patch that isn't in mainline yet? add it to the patch set though it isn't ep93xx related?

I see your point.
That change would likely fix this issue.

Include this fix in your next revision if it hasn't been accepted into the mainline. I will not be able to ack it but at least it would not hold up the review. The ack-ing would be done, i believe, by the flash-nand custodian, Scott W or Wolfgang.

Tom