Skip to contentSkip to conversation

ARM: Add Altera SOCFPGA Cyclone5

PATCH Superseded dinguyen at altera.com 2 participants 3 messages Oct 4, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v8 1/1 ARM: Add Altera SOCFPGA Cyclone5

From: Dinh Nguyen <[email protected]>

Add minimal support for Altera's SOCFPGA Cyclone 5 hardware.

----
v8: Remove no_return attribute for reset_cpu

Based on v2012.10-rc2

---
 MAINTAINERS                                        |    5 +
 arch/arm/cpu/armv7/socfpga/Makefile                |   51 +++++
 arch/arm/cpu/armv7/socfpga/config.mk               |   16 ++
 arch/arm/cpu/armv7/socfpga/lowlevel_init.S         |   77 +++++++
 arch/arm/cpu/armv7/socfpga/misc.c                  |   54 +++++
 arch/arm/cpu/armv7/socfpga/spl.c                   |   48 ++++
 arch/arm/cpu/armv7/socfpga/timer.c                 |  105 +++++++++
 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds          |   60 +++++
 arch/arm/include/asm/arch-socfpga/reset_manager.h  |   37 +++
 .../include/asm/arch-socfpga/socfpga_base_addrs.h  |   27 +++
 arch/arm/include/asm/arch-socfpga/spl.h            |   26 +++
 arch/arm/include/asm/arch-socfpga/timer.h          |   29 +++
 board/altera/socfpga_cyclone5/Makefile             |   50 +++++
 board/altera/socfpga_cyclone5/socfpga_cyclone5.c   |   80 +++++++
 boards.cfg                                         |    1 +
 include/configs/socfpga_cyclone5.h                 |  236 ++++++++++++++++++++
 16 files changed, 902 insertions(+)
 create mode 100644 arch/arm/cpu/armv7/socfpga/Makefile
 create mode 100644 arch/arm/cpu/armv7/socfpga/config.mk
 create mode 100644 arch/arm/cpu/armv7/socfpga/lowlevel_init.S
 create mode 100644 arch/arm/cpu/armv7/socfpga/misc.c
 create mode 100644 arch/arm/cpu/armv7/socfpga/spl.c
 create mode 100644 arch/arm/cpu/armv7/socfpga/timer.c
 create mode 100644 arch/arm/cpu/armv7/socfpga/u-boot-spl.lds
 create mode 100644 arch/arm/include/asm/arch-socfpga/reset_manager.h
 create mode 100644 arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h
 create mode 100644 arch/arm/include/asm/arch-socfpga/spl.h
 create mode 100644 arch/arm/include/asm/arch-socfpga/timer.h
 create mode 100644 board/altera/socfpga_cyclone5/Makefile
 create mode 100644 board/altera/socfpga_cyclone5/socfpga_cyclone5.c
 create mode 100644 include/configs/socfpga_cyclone5.h
MAINTAINERS +5 -0
index aa54fe1..ee8cfb0 100644
@@ -777,6 +777,11 @@ Nagendra T S  <[email protected]>
 
    am3517_crane    ARM ARMV7 (AM35x SoC)
 
+Dinh Nguyen <[email protected]>
+Chin Liang See <[email protected]>
+
+	socfpga		socfpga_cyclone5
+
 Sandeep Paulraj <[email protected]>
 
 	davinci_dm355evm	ARM926EJS
arch/arm/cpu/armv7/socfpga/Makefile new file +51 -0

51 lines not on this page · raw message

arch/arm/cpu/armv7/socfpga/config.mk new file +16 -0
new file mode 100644
index 0000000..b72ed1e
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2011, Texas Instruments, Incorporated - http://www.ti.com/
+#
+# 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 "as is" WITHOUT ANY WARRANTY of any
+# kind, whether express or implied; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+ifndef CONFIG_SPL_BUILD
+ALL-y	+= $(obj)u-boot.img
+endif
arch/arm/cpu/armv7/socfpga/lowlevel_init.S new file +77 -0

77 lines not on this page · raw message

arch/arm/cpu/armv7/socfpga/misc.c new file +54 -0

54 lines not on this page · raw message

arch/arm/cpu/armv7/socfpga/spl.c new file +48 -0

48 lines not on this page · raw message

arch/arm/cpu/armv7/socfpga/timer.c new file +105 -0

105 lines not on this page · raw message

arch/arm/cpu/armv7/socfpga/u-boot-spl.lds new file +60 -0

60 lines not on this page · raw message

arch/arm/include/asm/arch-socfpga/reset_manager.h new file +37 -0
new file mode 100644
index 0000000..d9d2c1c
@@ -0,0 +1,37 @@
+/*
+ *  Copyright (C) 2012 Altera Corporation <www.altera.com>
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef	_RESET_MANAGER_H_
+#define	_RESET_MANAGER_H_
+
+void reset_cpu(ulong addr);
+void reset_deassert_peripherals_handoff(void);
+
+struct socfpga_reset_manager {
+	u32	padding1;
+	u32	ctrl;
+	u32	padding2;
+	u32	padding3;
+	u32	mpu_mod_reset;
+	u32	per_mod_reset;
+	u32	per2_mod_reset;
+	u32	brg_mod_reset;
+};
+
+#define RSTMGR_CTRL_SWWARMRSTREQ_LSB 1
+
+#endif /* _RESET_MANAGER_H_ */
arch/arm/include/asm/arch-socfpga/socfpga_base_addrs.h new file +27 -0
new file mode 100644
index 0000000..f353eb2
@@ -0,0 +1,27 @@
+/*
+ *  Copyright (C) 2012 Altera Corporation <www.altera.com>
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SOCFPGA_BASE_ADDRS_H_
+#define _SOCFPGA_BASE_ADDRS_H_
+
+#define SOCFPGA_L3REGS_ADDRESS 0xff800000
+#define SOCFPGA_UART0_ADDRESS 0xffc02000
+#define SOCFPGA_UART1_ADDRESS 0xffc03000
+#define SOCFPGA_OSC1TIMER0_ADDRESS 0xffd00000
+#define SOCFPGA_RSTMGR_ADDRESS 0xffd05000
+
+#endif /* _SOCFPGA_BASE_ADDRS_H_ */
arch/arm/include/asm/arch-socfpga/spl.h new file +26 -0
new file mode 100644
index 0000000..efd0c06
@@ -0,0 +1,26 @@
+/*
+ *  Copyright (C) 2012 Pavel Machek <[email protected]>
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SOCFPGA_SPL_H_
+#define _SOCFPGA_SPL_H_
+
+/* Symbols from linker script */
+extern char __malloc_start, __malloc_end, __stack_start;
+
+#define BOOT_DEVICE_RAM 1
+
+#endif
arch/arm/include/asm/arch-socfpga/timer.h new file +29 -0
new file mode 100644
index 0000000..830c94a
@@ -0,0 +1,29 @@
+/*
+ *  Copyright (C) 2012 Altera Corporation <www.altera.com>
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _SOCFPGA_TIMER_H_
+#define _SOCFPGA_TIMER_H_
+
+struct socfpga_timer {
+	u32	load_val;
+	u32	curr_val;
+	u32	ctrl;
+	u32	eoi;
+	u32	int_stat;
+};
+
+#endif
board/altera/socfpga_cyclone5/Makefile new file +50 -0

50 lines not on this page · raw message

board/altera/socfpga_cyclone5/socfpga_cyclone5.c new file +80 -0

80 lines not on this page · raw message

boards.cfg +1 -0
index f789539..2388cee 100644
@@ -272,6 +272,7 @@ ventana                      arm         armv7:arm720t ventana           nvidia
 whistler                     arm         armv7:arm720t whistler          nvidia         tegra20
 u8500_href                   arm         armv7       u8500               st-ericsson    u8500
 snowball                     arm         armv7       snowball               st-ericsson    u8500
+socfpga_cyclone5             arm         armv7       socfpga_cyclone5    altera		    socfpga
 actux1_4_16                  arm         ixp         actux1              -              -           actux1:FLASH2X2
 actux1_4_32                  arm         ixp         actux1              -              -           actux1:FLASH2X2,RAM_32MB
 actux1_8_16                  arm         ixp         actux1              -              -           actux1:FLASH1X8
include/configs/socfpga_cyclone5.h new file +236 -0

236 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v8 1/1 ARM: Add Altera SOCFPGA Cyclone5

Hi dinguyen at altera.com,

Quoted 12 lines · On Thu, 4 Oct 2012 10:46:02 -0600, <[email protected]> wrote:

From: Dinh Nguyen <[email protected]>

Add minimal support for Altera's SOCFPGA Cyclone 5 hardware.

Quoted 2 lines

----
v8: Remove no_return attribute for reset_cpu

Applied to u-boot-arm/master, thanks.

Amicalement,

Signature · 1 line
Albert.
#2 lore raw

PATCH v8 1/1 ARM: Add Altera SOCFPGA Cyclone5

Hi Albert,

Quoted 19 lines · ZY - albert.u.boot

Hi dinguyen at altera.com,

Quoted 12 lines · On Thu, 4 Oct 2012 10:46:02 -0600, <[email protected]> wrote:

From: Dinh Nguyen <[email protected]>

Add minimal support for Altera's SOCFPGA Cyclone 5 hardware.

Quoted 2 lines

----
v8: Remove no_return attribute for reset_cpu

Quoted 1 line

Applied to u-boot-arm/master, thanks.

Thanks alot!

Dinh

Quoted 2 lines

Amicalement,