Skip to contentSkip to conversation

README: fix references to config_cmd_default.h

PATCH New Stephen Warren 3 participants 7 messages Aug 6, 2012 – Oct 2, 2012

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

PATCH v4 1/4 README: fix references to config_cmd_default.h

All usage of config_cmd_default.h uses <> for the include statement. Update the README to do the same, rather than using "".

---
v4: No change
v3: No change
v2: New patch

---
 README |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
README +2 -2
index dac46f3..a7deaf4 100644
@@ -744,8 +744,8 @@ The following options need to be configured:
 - Monitor Functions:
 		Monitor commands can be included or excluded
 		from the build by using the #include files
-		"config_cmd_all.h" and #undef'ing unwanted
-		commands, or using "config_cmd_default.h"
+		<config_cmd_all.h> and #undef'ing unwanted
+		commands, or using <config_cmd_default.h>
 		and augmenting with additional #define's
 		for wanted commands.
 
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v4 2/4 ARM: arm1176: enable instruction cache in arch_cpu_init()

Note that this affects all users of the ARM1176 CPU that enable CONFIG_ARCH_CPU_INIT, not just the BCM2835 SoC, potentially such as tnetv107x.

Cc Cyril Chemparathy <[email protected]>

---
v4: No change
v3: No change, re-ordered patch
v2: No change

---
 arch/arm/cpu/arm1176/cpu.c |    7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/cpu/arm1176/cpu.c +7 -0
index c0fd114..532a90b 100644
@@ -65,3 +65,10 @@ static void cache_flush (void)
 	/* mem barrier to sync things */
 	asm ("mcr p15, 0, %0, c7, c10, 4": :"r" (0));
 }
+
+int arch_cpu_init(void)
+{
+	icache_enable();
+
+	return 0;
+}
Signature · 1 line
1.7.9.5
#2 lore raw

PATCH v4 2/4 ARM: arm1176: enable instruction cache in arch_cpu_init()

Quoted 6 lines · Stephen Warren

Note that this affects all users of the ARM1176 CPU that enable CONFIG_ARCH_CPU_INIT, not just the BCM2835 SoC, potentially such as tnetv107x.

Cc Cyril Chemparathy <[email protected]>
Quoted 30 lines

---
v4: No change
v3: No change, re-ordered patch
v2: No change

---
 arch/arm/cpu/arm1176/cpu.c |    7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/cpu/arm1176/cpu.c +7 -1
index c0fd114..532a90b 100644
@@ -65,3 +65,10 @@ static void cache_flush (void)
        /* mem barrier to sync things */
        asm ("mcr p15, 0, %0, c7, c10, 4": :"r" (0));
 }
+
+int arch_cpu_init(void)
+{
+       icache_enable();
+
+       return 0;
+}
--

1.7.9.5

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#3 lore raw

PATCH v4 3/4 ARM: add basic support for the Broadcom BCM2835 SoC

In reply to Stephen Warren

This SoC is used in the Raspberry Pi, for example.

For more details, see:
http://www.broadcom.com/products/BCM2835
http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf.

Initial support is enough to boot to a serial console, execute a minimal set of U-Boot commands, download data over a serial port, and boot a Linux kernel. No storage or network drivers are implemented.

GPIO driver originally by Vikram Narayanan <[email protected]> with many fixes from myself.

---
v4: No change
v3: Squash base SoC, watchdog, and GPIO driver patches into one.

---
 arch/arm/cpu/arm1176/bcm2835/Makefile        |   37 +++++++++++
 arch/arm/cpu/arm1176/bcm2835/config.mk       |   19 ++++++
 arch/arm/cpu/arm1176/bcm2835/lowlevel_init.S |   19 ++++++
 arch/arm/cpu/arm1176/bcm2835/reset.c         |   35 ++++++++++
 arch/arm/cpu/arm1176/bcm2835/timer.c         |   55 ++++++++++++++++
 arch/arm/include/asm/arch-bcm2835/gpio.h     |   66 +++++++++++++++++++
 arch/arm/include/asm/arch-bcm2835/timer.h    |   37 +++++++++++
 arch/arm/include/asm/arch-bcm2835/wdog.h     |   37 +++++++++++
 drivers/gpio/Makefile                        |    1 +
 drivers/gpio/bcm2835_gpio.c                  |   90 ++++++++++++++++++++++++++
 10 files changed, 396 insertions(+)
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/Makefile
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/config.mk
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/lowlevel_init.S
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/reset.c
 create mode 100644 arch/arm/cpu/arm1176/bcm2835/timer.c
 create mode 100644 arch/arm/include/asm/arch-bcm2835/gpio.h
 create mode 100644 arch/arm/include/asm/arch-bcm2835/timer.h
 create mode 100644 arch/arm/include/asm/arch-bcm2835/wdog.h
 create mode 100644 drivers/gpio/bcm2835_gpio.c
arch/arm/cpu/arm1176/bcm2835/Makefile new file +37 -0
new file mode 100644
index 0000000..4ea6d6b
@@ -0,0 +1,37 @@
+#
+# 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
+# version 2 as published by the Free Software Foundation.
+#
+# 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(SOC).o
+
+SOBJS	:= lowlevel_init.o
+COBJS	:= reset.o timer.o
+
+SRCS	:= $(SOBJS:.o=.c) $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
arch/arm/cpu/arm1176/bcm2835/config.mk new file +19 -0
new file mode 100644
index 0000000..b87ce24
@@ -0,0 +1,19 @@
+#
+# (C) Copyright 2012 Stephen Warren
+#
+# 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
+# version 2 as published by the Free Software Foundation.
+#
+# 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.
+
+# Don't attempt to override the target CPU/ABI options;
+# the Raspberry Pi toolchain does the right thing by default.
+PLATFORM_RELFLAGS := $(filter-out -msoft-float,$(PLATFORM_RELFLAGS))
+PLATFORM_CPPFLAGS := $(filter-out -march=armv5t,$(PLATFORM_CPPFLAGS))
arch/arm/cpu/arm1176/bcm2835/lowlevel_init.S new file +19 -0
new file mode 100644
index 0000000..c7b0843
@@ -0,0 +1,19 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * 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
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+.globl lowlevel_init
+lowlevel_init:
+	mov	pc, lr
arch/arm/cpu/arm1176/bcm2835/reset.c new file +35 -0
new file mode 100644
index 0000000..8c37ad9
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * 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
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include <asm/arch/wdog.h>
+
+#define RESET_TIMEOUT 10
+
+void reset_cpu(ulong addr)
+{
+	struct bcm2835_wdog_regs *regs =
+		(struct bcm2835_wdog_regs *)BCM2835_WDOG_PHYSADDR;
+	uint32_t rstc;
+
+	rstc = readl(&regs->rstc);
+	rstc &= ~BCM2835_WDOG_RSTC_WRCFG_MASK;
+	rstc |= BCM2835_WDOG_RSTC_WRCFG_FULL_RESET;
+
+	writel(BCM2835_WDOG_PASSWORD | RESET_TIMEOUT, &regs->wdog);
+	writel(BCM2835_WDOG_PASSWORD | rstc, &regs->rstc);
+}
arch/arm/cpu/arm1176/bcm2835/timer.c new file +55 -0

55 lines not on this page · raw message

arch/arm/include/asm/arch-bcm2835/gpio.h new file +66 -0

66 lines not on this page · raw message

arch/arm/include/asm/arch-bcm2835/timer.h new file +37 -0
new file mode 100644
index 0000000..30c70e0
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * 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
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#ifndef _BCM2835_TIMER_H
+#define _BCM2835_TIMER_H
+
+#define BCM2835_TIMER_PHYSADDR	0x20003000
+
+struct bcm2835_timer_regs {
+	u32 cs;
+	u32 clo;
+	u32 chi;
+	u32 c0;
+	u32 c1;
+	u32 c2;
+	u32 c3;
+};
+
+#define BCM2835_TIMER_CS_M3	(1 << 3)
+#define BCM2835_TIMER_CS_M2	(1 << 2)
+#define BCM2835_TIMER_CS_M1	(1 << 1)
+#define BCM2835_TIMER_CS_M0	(1 << 0)
+
+#endif
arch/arm/include/asm/arch-bcm2835/wdog.h new file +37 -0
new file mode 100644
index 0000000..d750a62
@@ -0,0 +1,37 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * 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
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#ifndef _BCM2835_TIMER_H
+#define _BCM2835_TIMER_H
+
+#define BCM2835_WDOG_PHYSADDR			0x20100000
+
+struct bcm2835_wdog_regs {
+	u32 unknown0[7];
+	u32 rstc;
+	u32 unknown1;
+	u32 wdog;
+};
+
+#define BCM2835_WDOG_PASSWORD			0x5a000000
+
+#define BCM2835_WDOG_RSTC_WRCFG_MASK		0x00000030
+#define BCM2835_WDOG_RSTC_WRCFG_FULL_RESET	0x00000020
+
+#define BCM2835_WDOG_WDOG_TIMEOUT_MASK		0x0000ffff
+
+#endif
+
drivers/gpio/Makefile +1 -0
index 32a2474..8d2f2b2 100644
@@ -40,6 +40,7 @@ COBJS-$(CONFIG_TEGRA_GPIO)	+= tegra_gpio.o
 COBJS-$(CONFIG_DA8XX_GPIO)	+= da8xx_gpio.o
 COBJS-$(CONFIG_ALTERA_PIO)	+= altera_pio.o
 COBJS-$(CONFIG_MPC83XX_GPIO)	+= mpc83xx_gpio.o
+COBJS-$(CONFIG_BCM2835_GPIO)	+= bcm2835_gpio.o
 
 COBJS	:= $(COBJS-y)
 SRCS 	:= $(COBJS:.o=.c)
drivers/gpio/bcm2835_gpio.c new file +90 -0

90 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#4 lore raw

PATCH v4 4/4 ARM: add Raspberry Pi model B board, using BCM2835 SoC

In reply to Stephen Warren

The Raspberry Pi model B uses the BCM2835 SoC, has 256MB of RAM, contains an SMSC 9512 USB LAN/Hub chip, and various IO connectors. For more details, see http://www.raspberrypi.org/.

Various portions (cache enable, MACH_TYPE setup, RAM size limit, stack relocation to top of RAM) extracted from work by:
Oleksandr Tymoshenko <[email protected]>.

GPIO driver enablement by Vikram Narayanan <[email protected]>.

---
v4: Remove redundant CONFIG_SYS_BAUDRATE_TABLE, CONFIG_SYS_PROMPT_HUSH_PS2.
v3: Squash a number of patches into this single patch.

---
 MAINTAINERS                      |    4 ++
 board/raspberrypi/rpi_b/Makefile |   34 +++++++++++++
 board/raspberrypi/rpi_b/rpi_b.c  |   34 +++++++++++++
 boards.cfg                       |    1 +
 include/configs/rpi_b.h          |  104 ++++++++++++++++++++++++++++++++++++++
 5 files changed, 177 insertions(+)
 create mode 100644 board/raspberrypi/rpi_b/Makefile
 create mode 100644 board/raspberrypi/rpi_b/rpi_b.c
 create mode 100644 include/configs/rpi_b.h
MAINTAINERS +4 -0
index fd0c65c..abe621e 100644
@@ -928,6 +928,10 @@ Stephen Warren <[email protected]>
 	trimslice	Tegra2 (ARM7 & A9 Dual Core)
 	whistler	Tegra2 (ARM7 & A9 Dual Core)
 
+Stephen Warren <[email protected]>
+
+	rpi_b		BCM2835 (ARM1176)
+
 Thomas Weber <[email protected]>
 
 	devkit8000	ARM ARMV7 (OMAP3530 SoC)
board/raspberrypi/rpi_b/Makefile new file +34 -0
new file mode 100644
index 0000000..9d0c377
@@ -0,0 +1,34 @@
+#
+# 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
+# version 2 as published by the Free Software Foundation.
+#
+# 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.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)lib$(BOARD).o
+
+COBJS	:= $(BOARD).o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
board/raspberrypi/rpi_b/rpi_b.c new file +34 -0
new file mode 100644
index 0000000..688b0aa
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2012 Stephen Warren
+ *
+ * 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
+ * version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#include <common.h>
+#include <asm/global_data.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int dram_init(void)
+{
+	gd->ram_size = CONFIG_SYS_SDRAM_SIZE;
+
+	return 0;
+}
+
+int board_init(void)
+{
+	gd->bd->bi_boot_params = 0x100;
+
+	return 0;
+}
boards.cfg +1 -0
index 2d36d83..7a88eb9 100644
@@ -48,6 +48,7 @@ mx35pdk                      arm         arm1136     -                   freesca
 apollon			     arm	 arm1136     apollon		 -	        omap24xx
 omap2420h4                   arm         arm1136     -                   ti             omap24xx
 tnetv107x_evm                arm         arm1176     tnetv107xevm        ti             tnetv107x
+rpi_b                        arm         arm1176     rpi_b               raspberrypi    bcm2835
 integratorap_cm720t          arm         arm720t     integrator          armltd         -           integratorap:CM720T
 integratorap_cm920t          arm         arm920t     integrator          armltd         -           integratorap:CM920T
 integratorcp_cm920t          arm         arm920t     integrator          armltd         -           integratorcp:CM920T
include/configs/rpi_b.h new file +104 -0

104 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#5 lore raw

PATCH v4 4/4 ARM: add Raspberry Pi model B board, using BCM2835 SoC

Quoted 11 lines · Stephen Warren

The Raspberry Pi model B uses the BCM2835 SoC, has 256MB of RAM, contains an SMSC 9512 USB LAN/Hub chip, and various IO connectors. For more details, see http://www.raspberrypi.org/.

Various portions (cache enable, MACH_TYPE setup, RAM size limit, stack relocation to top of RAM) extracted from work by:
Oleksandr Tymoshenko <[email protected]>.

GPIO driver enablement by Vikram Narayanan <[email protected]>.

Thanks for cycling over the series again.

Signature · 1 line
Tom
#6 lore raw

PATCH v4 1/4 README: fix references to config_cmd_default.h

In reply to Stephen Warren
Quoted 4 lines · Stephen Warren

All usage of config_cmd_default.h uses <> for the include statement. Update the README to do the same, rather than using "".

I've applied the whole series to u-boot-staging/trini at ti.com, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120810/947874e9/attachment.pgp>