Skip to contentSkip to conversation

bcm2835/rpi: add SPDX license tags for some files

PATCH Superseded Stephen Warren 3 participants 7 messages Feb 10, 2015 – Feb 11, 2015

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 bcm2835/rpi: add SPDX license tags for some files

---
 arch/arm/cpu/arm1176/bcm2835/Makefile     | 12 ++----------
 arch/arm/include/asm/arch-bcm2835/sdhci.h | 12 +-----------
 arch/arm/include/asm/arch-bcm2835/timer.h | 12 +-----------
 arch/arm/include/asm/arch-bcm2835/wdog.h  | 12 +-----------
 board/raspberrypi/rpi/Makefile            | 12 ++----------
 board/raspberrypi/rpi/rpi.c               | 12 +-----------
 include/configs/rpi.h                     | 12 +-----------
 7 files changed, 9 insertions(+), 75 deletions(-)
arch/arm/cpu/arm1176/bcm2835/Makefile +2 -10
index 0ad36906dfc5..7e5dbe1fdeaf 100644
@@ -1,15 +1,7 @@
 #
-# See file CREDITS for list of people who contributed to this
-# project.
+# (C) Copyright 2012 Stephen Warren
 #
-# 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.
+# SPDX-License-Identifier:	GPL-2.0
 #
 
 obj-y	:= lowlevel_init.o
arch/arm/include/asm/arch-bcm2835/sdhci.h +1 -11
index a4f867b2e9a4..da4d5cd5a88f 100644
@@ -1,17 +1,7 @@
 /*
  * (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.
+ * SPDX-License-Identifier:	GPL-2.0
  */
 
 #ifndef _BCM2835_SDHCI_H_
arch/arm/include/asm/arch-bcm2835/timer.h +1 -11
index c2001b6f932a..2d7cfe5c56f8 100644
@@ -1,17 +1,7 @@
 /*
  * (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.
+ * SPDX-License-Identifier:	GPL-2.0
  */
 
 #ifndef _BCM2835_TIMER_H
arch/arm/include/asm/arch-bcm2835/wdog.h +1 -11
index 303a65f32e08..f369ab589c9a 100644
@@ -1,17 +1,7 @@
 /*
  * (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.
+ * SPDX-License-Identifier:	GPL-2.0
  */
 
 #ifndef _BCM2835_TIMER_H
board/raspberrypi/rpi/Makefile +2 -10
index c53c92b1ddb7..4ce2c983b382 100644
@@ -1,15 +1,7 @@
 #
-# See file CREDITS for list of people who contributed to this
-# project.
+# (C) Copyright 2012 Stephen Warren
 #
-# 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.
+# SPDX-License-Identifier:	GPL-2.0
 #
 
 obj-y	:= rpi.o
board/raspberrypi/rpi/rpi.c +1 -11
index c18271fce823..2185b1bd029a 100644
@@ -1,17 +1,7 @@
 /*
  * (C) Copyright 2012-2013 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.
+ * SPDX-License-Identifier:	GPL-2.0
  */
 
 #include <common.h>
include/configs/rpi.h +1 -11
index c94f4112026e..7075e3df7f89 100644
@@ -1,17 +1,7 @@
 /*
  * (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.
+ * SPDX-License-Identifier:	GPL-2.0
  */
 
 #ifndef __CONFIG_H
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/3 bcm2836 SoC support (used in Raspberry Pi 2 model B)

The bcm2835 and bcm2836 are essentially identical, except:
- The CPU is an ARM1176 v.s. a quad-core Cortex-A7.
- The physical address of many IO controllers has moved.

Rather than introducing a whole new bcm2836 value for $(SOC) or $(ARCH), update the existing bcm2835 code to handle the minor differences, and plumb it into the ARMv7 CPU architecture.

---
 arch/arm/cpu/armv7/Makefile               |  1 +
 arch/arm/cpu/armv7/bcm2835/Makefile       | 13 +++++++++++++
 arch/arm/include/asm/arch-bcm2835/gpio.h  |  5 +++++
 arch/arm/include/asm/arch-bcm2835/mbox.h  |  6 +++++-
 arch/arm/include/asm/arch-bcm2835/sdhci.h |  6 +++++-
 arch/arm/include/asm/arch-bcm2835/timer.h |  6 +++++-
 arch/arm/include/asm/arch-bcm2835/wdog.h  |  6 +++++-
 7 files changed, 39 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/bcm2835/Makefile
arch/arm/cpu/armv7/Makefile +1 -0
index 409e6f5651b6..7f77c729a191 100644
@@ -41,6 +41,7 @@ endif
 obj-$(if $(filter am33xx,$(SOC)),y) += am33xx/
 obj-$(if $(filter armada-xp,$(SOC)),y) += armada-xp/
 obj-$(CONFIG_AT91FAMILY) += at91/
+obj-$(CONFIG_BCM2835) += bcm2835/
 obj-$(if $(filter bcm281xx,$(SOC)),y) += bcm281xx/
 obj-$(if $(filter bcmcygnus,$(SOC)),y) += bcmcygnus/
 obj-$(if $(filter bcmnsp,$(SOC)),y) += bcmnsp/
arch/arm/cpu/armv7/bcm2835/Makefile new file +13 -0
new file mode 100644
index 000000000000..ed1ee4753d49
@@ -0,0 +1,13 @@
+#
+# (C) Copyright 2012 Stephen Warren
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+src_dir := ../../arm1176/bcm2835/
+
+obj-y	:=
+obj-y	+= $(src_dir)/init.o
+obj-y	+= $(src_dir)/reset.o
+obj-y	+= $(src_dir)/timer.o
+obj-y	+= $(src_dir)/mbox.o
arch/arm/include/asm/arch-bcm2835/gpio.h +5 -0
index db42896201b3..c8ef8f528a21 100644
@@ -1,6 +1,7 @@
 /*
  * Copyright (C) 2012 Vikram Narayananan
  * <[email protected]>
+ * (C) Copyright 2012,2015 Stephen Warren
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -8,7 +9,11 @@
 #ifndef _BCM2835_GPIO_H_
 #define _BCM2835_GPIO_H_
 
+#ifdef CONFIG_BCM2836
+#define BCM2835_GPIO_BASE		0x3f200000
+#else
 #define BCM2835_GPIO_BASE		0x20200000
+#endif
 #define BCM2835_GPIO_COUNT		54
 
 #define BCM2835_GPIO_FSEL_MASK		0x7
arch/arm/include/asm/arch-bcm2835/mbox.h +5 -1
index 88d2ec11a7c2..c4bbacaf3c3f 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2012 Stephen Warren
+ * (C) Copyright 2012,2015 Stephen Warren
  *
  * SPDX-License-Identifier:	GPL-2.0+
  */
@@ -38,7 +38,11 @@
 
 /* Raw mailbox HW */
 
+#ifdef CONFIG_BCM2836
+#define BCM2835_MBOX_PHYSADDR	0x3f00b880
+#else
 #define BCM2835_MBOX_PHYSADDR	0x2000b880
+#endif
 
 struct bcm2835_mbox_regs {
 	u32 read;
arch/arm/include/asm/arch-bcm2835/sdhci.h +5 -1
index da4d5cd5a88f..2a21ccbf66ba 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2012 Stephen Warren
+ * (C) Copyright 2012,2015 Stephen Warren
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -7,7 +7,11 @@
 #ifndef _BCM2835_SDHCI_H_
 #define _BCM2835_SDHCI_H_
 
+#ifdef CONFIG_BCM2836
+#define BCM2835_SDHCI_BASE 0x3f300000
+#else
 #define BCM2835_SDHCI_BASE 0x20300000
+#endif
 
 int bcm2835_sdhci_init(u32 regbase, u32 emmc_freq);
 
arch/arm/include/asm/arch-bcm2835/timer.h +5 -1
index 2d7cfe5c56f8..fc7aec7b7c59 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2012 Stephen Warren
+ * (C) Copyright 2012,2015 Stephen Warren
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -7,7 +7,11 @@
 #ifndef _BCM2835_TIMER_H
 #define _BCM2835_TIMER_H
 
+#ifdef CONFIG_BCM2836
+#define BCM2835_TIMER_PHYSADDR	0x3f003000
+#else
 #define BCM2835_TIMER_PHYSADDR	0x20003000
+#endif
 
 struct bcm2835_timer_regs {
 	u32 cs;
arch/arm/include/asm/arch-bcm2835/wdog.h +5 -1
index f369ab589c9a..beb6a0820601 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2012 Stephen Warren
+ * (C) Copyright 2012,2015 Stephen Warren
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -7,7 +7,11 @@
 #ifndef _BCM2835_TIMER_H
 #define _BCM2835_TIMER_H
 
+#ifdef CONFIG_BCM2836
+#define BCM2835_WDOG_PHYSADDR			0x3f100000
+#else
 #define BCM2835_WDOG_PHYSADDR			0x20100000
+#endif
 
 struct bcm2835_wdog_regs {
 	u32 unknown0[7];
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/3 bcm2836 SoC support (used in Raspberry Pi 2 model B)

Hi Tom,

Quoted 8 lines · On Mon, 9 Feb 2015 23:56:45 -0700 Stephen Warren <[email protected]> wrote:

The bcm2835 and bcm2836 are essentially identical, except:
- The CPU is an ARM1176 v.s. a quad-core Cortex-A7.
- The physical address of many IO controllers has moved.

Rather than introducing a whole new bcm2836 value for $(SOC) or $(ARCH), update the existing bcm2835 code to handle the minor differences, and plumb it into the ARMv7 CPU architecture.

[ snip ]

Quoted 9 lines
arch/arm/cpu/armv7/bcm2835/Makefile new file +3 -0
new file mode 100644
index 000000000000..ed1ee4753d49
@@ -0,0 +1,13 @@
+#
+# (C) Copyright 2012 Stephen Warren
+#

arch/arm/cpu/armv7/bcm2835/Makefile line 13

Quoted 10 lines
arch/arm/cpu/armv7/bcm2835/Makefile new file +10 -0
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+src_dir := ../../arm1176/bcm2835/
+
+obj-y	:=
+obj-y	+= $(src_dir)/init.o
+obj-y	+= $(src_dir)/reset.o
+obj-y	+= $(src_dir)/timer.o
+obj-y	+= $(src_dir)/mbox.o

Tom,

Here is another proof that the arch/$(ARCH)/cpu/$(CPU)/$(SOC) structure is wrong. BCM2836 crib most of the source files from BCM2835
but they must be placed separetely because of the difference of the main processor.

Could you tell me your impression about my RFC series? (Anyway, it is already out-dated. I can rebase if you like.)

Of course, we can merge arch/arm/cpu/arm1176/bcm2835 and arch/arm/cpu/armv7/bcm2836 into arch/arm/mach-bcm lator.

What I can tell now is: more we wait, more work we will have to do.

Best Regards
Masahiro Yamada

#3 lore raw

PATCH 2/3 bcm2836 SoC support (used in Raspberry Pi 2 model B)

Hi,

Quoted 43 lines · Masahiro Yamada

Hi Tom,

Quoted 8 lines · On Mon, 9 Feb 2015 23:56:45 -0700 Stephen Warren <[email protected]> wrote:

The bcm2835 and bcm2836 are essentially identical, except:
- The CPU is an ARM1176 v.s. a quad-core Cortex-A7.
- The physical address of many IO controllers has moved.

Rather than introducing a whole new bcm2836 value for $(SOC) or $(ARCH), update the existing bcm2835 code to handle the minor differences, and plumb it into the ARMv7 CPU architecture.

[ snip ]

Quoted 9 lines
arch/arm/cpu/armv7/bcm2835/Makefile new file +3 -0
new file mode 100644
index 000000000000..ed1ee4753d49
@@ -0,0 +1,13 @@
+#
+# (C) Copyright 2012 Stephen Warren
+#

arch/arm/cpu/armv7/bcm2835/Makefile line 13

Quoted 10 lines
arch/arm/cpu/armv7/bcm2835/Makefile new file +10 -0
+# SPDX-License-Identifier:   GPL-2.0+
+#
+
+src_dir := ../../arm1176/bcm2835/
+
+obj-y        :=
+obj-y        += $(src_dir)/init.o
+obj-y        += $(src_dir)/reset.o
+obj-y        += $(src_dir)/timer.o
+obj-y        += $(src_dir)/mbox.o

Tom,

Here is another proof that the arch/$(ARCH)/cpu/$(CPU)/$(SOC) structure is wrong. BCM2836 crib most of the source files from BCM2835
but they must be placed separetely because of the difference of the main processor.

Quoted 7 lines

Could you tell me your impression about my RFC series? (Anyway, it is already out-dated. I can rebase if you like.)

Of course, we can merge arch/arm/cpu/arm1176/bcm2835 and arch/arm/cpu/armv7/bcm2836 into arch/arm/mach-bcm lator.

What I can tell now is: more we wait, more work we will have to do.

Agreed, it would be good to apply Masahiro's series right away.

Regards,
Simon

#4 lore raw

PATCH 2/3 bcm2836 SoC support (used in Raspberry Pi 2 model B)

In reply to Masahiro Yamada
Quoted 38 lines · Masahiro Yamada

Hi Tom,

Quoted 8 lines · On Mon, 9 Feb 2015 23:56:45 -0700 Stephen Warren <[email protected]> wrote:

The bcm2835 and bcm2836 are essentially identical, except:
- The CPU is an ARM1176 v.s. a quad-core Cortex-A7.
- The physical address of many IO controllers has moved.

Rather than introducing a whole new bcm2836 value for $(SOC) or $(ARCH), update the existing bcm2835 code to handle the minor differences, and plumb it into the ARMv7 CPU architecture.

[ snip ]

Quoted 9 lines
arch/arm/cpu/armv7/bcm2835/Makefile new file +3 -0
new file mode 100644
index 000000000000..ed1ee4753d49
@@ -0,0 +1,13 @@
+#
+# (C) Copyright 2012 Stephen Warren
+#

arch/arm/cpu/armv7/bcm2835/Makefile line 13

Quoted 10 lines
arch/arm/cpu/armv7/bcm2835/Makefile new file +10 -0
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+src_dir := ../../arm1176/bcm2835/
+
+obj-y	:=
+obj-y	+= $(src_dir)/init.o
+obj-y	+= $(src_dir)/reset.o
+obj-y	+= $(src_dir)/timer.o
+obj-y	+= $(src_dir)/mbox.o

Tom,

Quoted 6 lines

Here is another proof that the arch/$(ARCH)/cpu/$(CPU)/$(SOC) structure is wrong. BCM2836 crib most of the source files from BCM2835
but they must be placed separetely because of the difference of the main processor.

Could you tell me your impression about my RFC series? (Anyway, it is already out-dated. I can rebase if you like.)

FWIW, I did wonder about basing my patches on top of your directory re-org. However, since it was (IIRC) an RFC, I shied away from that for now.

Quoted 2 lines

Of course, we can merge arch/arm/cpu/arm1176/bcm2835 and arch/arm/cpu/armv7/bcm2836 into arch/arm/mach-bcm lator.

mach-bcm2835 or mach-bcm283x would likely be better than mach-bcm, since there are various other lines of Broadcom SoCs (some already supported in U-Boot), and I have no particular reason to believe they share design with the bcm2835/6.

#5 lore raw

PATCH 3/3 rpi: add support for Raspberry Pi 2 model B

In reply to Stephen Warren

The "get board rev" firmware API doesn't seem to return a useful value on this platform, so we hard-code the board ID for now, since there's only one bcm2836-based RPi board at present.

USB doesn't seem to work yet; the controller detects the on-board Hub/ Ethernet device but can't read the descriptors from it. I haven't investigated yet.

HDMI is untested.

---
 arch/arm/Kconfig                         |   5 +
 arch/arm/include/asm/arch-bcm2835/mbox.h |   4 +
 board/raspberrypi/rpi/rpi.c              |  26 ++++-
 board/raspberrypi/rpi_2/Kconfig          |  15 +++
 board/raspberrypi/rpi_2/MAINTAINERS      |   6 ++
 board/raspberrypi/rpi_2/Makefile         |   7 ++
 configs/rpi_2_defconfig                  |   2 +
 include/configs/{rpi.h => rpi-common.h}  |  16 ++-
 include/configs/rpi.h                    | 175 +------------------------------
 include/configs/rpi_2.h                  |  15 +++
 10 files changed, 93 insertions(+), 178 deletions(-)
 create mode 100644 board/raspberrypi/rpi_2/Kconfig
 create mode 100644 board/raspberrypi/rpi_2/MAINTAINERS
 create mode 100644 board/raspberrypi/rpi_2/Makefile
 create mode 100644 configs/rpi_2_defconfig
 copy include/configs/{rpi.h => rpi-common.h} (92%)
 create mode 100644 include/configs/rpi_2.h
arch/arm/Kconfig +5 -0
index 47806f85dafa..b916eb0dd44c 100644
@@ -413,6 +413,10 @@ config TARGET_RPI
 	bool "Support rpi"
 	select CPU_ARM1176
 
+config TARGET_RPI_2
+	bool "Support rpi_2"
+	select CPU_V7
+
 config TARGET_TNETV107X_EVM
 	bool "Support tnetv107x_evm"
 	select CPU_ARM1176
@@ -958,6 +962,7 @@ source "board/phytec/pcm051/Kconfig"
 source "board/ppcag/bg0900/Kconfig"
 source "board/pxa255_idp/Kconfig"
 source "board/raspberrypi/rpi/Kconfig"
+source "board/raspberrypi/rpi_2/Kconfig"
 source "board/ronetix/pm9261/Kconfig"
 source "board/ronetix/pm9263/Kconfig"
 source "board/ronetix/pm9g45/Kconfig"
arch/arm/include/asm/arch-bcm2835/mbox.h +4 -0
index c4bbacaf3c3f..8b7ff8165617 100644
@@ -125,6 +125,9 @@ struct bcm2835_mbox_tag_hdr {
 
 #define BCM2835_MBOX_TAG_GET_BOARD_REV	0x00010002
 
+#ifdef CONFIG_BCM2836
+#define BCM2836_BOARD_REV_2_B		0x1
+#else
 /*
  * 0x2..0xf from:
  * http://raspberryalphaomega.org.uk/2013/02/06/automatic-raspberry-pi-board-revision-detection-model-a-b1-and-b2/
@@ -145,6 +148,7 @@ struct bcm2835_mbox_tag_hdr {
 #define BCM2835_BOARD_REV_B_PLUS	0x10
 #define BCM2835_BOARD_REV_CM		0x11
 #define BCM2835_BOARD_REV_A_PLUS	0x12
+#endif
 
 struct bcm2835_mbox_tag_get_board_rev {
 	struct bcm2835_mbox_tag_hdr tag_hdr;
board/raspberrypi/rpi/rpi.c +24 -2
index 2185b1bd029a..314d1672f80a 100644
@@ -1,5 +1,5 @@
 /*
- * (C) Copyright 2012-2013 Stephen Warren
+ * (C) Copyright 2012-2013,2015 Stephen Warren
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
@@ -28,7 +28,11 @@ U_BOOT_DEVICE(bcm2835_gpios) = {
 };
 
 static const struct pl01x_serial_platdata serial_platdata = {
+#ifdef CONFIG_BCM2836
+	.base = 0x3f201000,
+#else
 	.base = 0x20201000,
+#endif
 	.type = TYPE_PL011,
 	.clock = 3000000,
 };
@@ -76,9 +80,20 @@ static const struct {
 } models[] = {
 	[0] = {
 		"Unknown model",
+#ifdef CONFIG_BCM2836
+		"bcm2836-rpi-other.dtb",
+#else
 		"bcm2835-rpi-other.dtb",
+#endif
 		false,
 	},
+#ifdef CONFIG_BCM2836
+	[BCM2836_BOARD_REV_2_B] = {
+		"2 Model B",
+		"bcm2836-rpi-2-b.dtb",
+		true,
+	},
+#else
 	[BCM2835_BOARD_REV_B_I2C0_2] = {
 		"Model B (no P5)",
 		"bcm2835-rpi-b-i2c0.dtb",
@@ -149,6 +164,7 @@ static const struct {
 		"bcm2835-rpi-a-plus.dtb",
 		false,
 	},
+#endif
 };
 
 u32 rpi_board_rev = 0;
@@ -242,10 +258,15 @@ static int power_on_module(u32 module)
 
 static void get_board_rev(void)
 {
+#ifndef CONFIG_BCM2836
 	ALLOC_ALIGN_BUFFER(struct msg_get_board_rev, msg, 1, 16);
 	int ret;
+#endif
 	const char *name;
 
+#ifdef CONFIG_BCM2836
+	rpi_board_rev = BCM2836_BOARD_REV_2_B;
+#else
 	BCM2835_MBOX_INIT_HDR(msg);
 	BCM2835_MBOX_INIT_TAG(&msg->get_board_rev, GET_BOARD_REV);
 
@@ -266,9 +287,10 @@ static void get_board_rev(void)
 		printf("RPI: Board rev %u unknown\n", rpi_board_rev);
 		rpi_board_rev = 0;
 	}
+#endif
 
 	name = models[rpi_board_rev].name;
-	printf("RPI model: %s\n", name);
+	printf("RPI %s\n", name);
 }
 
 int board_init(void)
board/raspberrypi/rpi_2/Kconfig new file +15 -0
new file mode 100644
index 000000000000..032184d5ad54
@@ -0,0 +1,15 @@
+if TARGET_RPI_2
+
+config SYS_BOARD
+	default "rpi_2"
+
+config SYS_VENDOR
+	default "raspberrypi"
+
+config SYS_SOC
+	default "bcm2835"
+
+config SYS_CONFIG_NAME
+	default "rpi_2"
+
+endif
board/raspberrypi/rpi_2/MAINTAINERS new file +6 -0
new file mode 100644
index 000000000000..85a480c9d1b0
@@ -0,0 +1,6 @@
+RPI_2 BOARD
+M:	Stephen Warren <[email protected]>
+S:	Maintained
+F:	board/raspberrypi/rpi_2/
+F:	include/configs/rpi_2.h
+F:	configs/rpi_2_defconfig
board/raspberrypi/rpi_2/Makefile new file +7 -0
new file mode 100644
index 000000000000..d82cd21f4cf7
@@ -0,0 +1,7 @@
+#
+# (C) Copyright 2012,2015 Stephen Warren
+#
+# SPDX-License-Identifier:	GPL-2.0
+#
+
+obj-y	:= ../rpi/rpi.o
configs/rpi_2_defconfig new file +2 -0
new file mode 100644
index 000000000000..3075321551c5
@@ -0,0 +1,2 @@
+CONFIG_ARM=y
+CONFIG_TARGET_RPI_2=y
include/configs/rpi-common.h renamed from include/configs/rpi.h +13 -3
similarity index 92%
copy from include/configs/rpi.h
copy to include/configs/rpi-common.h
index 7075e3df7f89..7e7625d991f6 100644
@@ -1,11 +1,11 @@
 /*
- * (C) Copyright 2012 Stephen Warren
+ * (C) Copyright 2012,2015 Stephen Warren
  *
  * SPDX-License-Identifier:	GPL-2.0
  */
 
-#ifndef __CONFIG_H
-#define __CONFIG_H
+#ifndef _RPI_COMMON_H_
+#define _RPI_COMMON_H_
 
 #include <linux/sizes.h>
 
@@ -17,8 +17,14 @@
 /*
  * 2835 is a SKU in a series for which the 2708 is the first or primary SoC,
  * so 2708 has historically been used rather than a dedicated 2835 ID.
+ *
+ * We don't define a machine type for bcm2709/bcm2836 since the RPi Foundation
+ * chose to use someone else's previously registered machine ID (3139, MX51_GGC)
+ * rather than obtaining a valid ID:-/
  */
+#ifndef CONFIG_BCM2836
 #define CONFIG_MACH_TYPE		MACH_TYPE_BCM2708
+#endif
 
 /* Enable driver model */
 #define CONFIG_DM
@@ -76,7 +82,11 @@
 #define CONFIG_CMD_USB
 #ifdef CONFIG_CMD_USB
 #define CONFIG_USB_DWC2
+#ifdef CONFIG_BCM2836
+#define CONFIG_USB_DWC2_REG_ADDR 0x3f980000
+#else
 #define CONFIG_USB_DWC2_REG_ADDR 0x20980000
+#endif
 #define CONFIG_USB_STORAGE
 #define CONFIG_USB_HOST_ETHER
 #define CONFIG_USB_ETHER_SMSC95XX
include/configs/rpi.h +2 -173

184 lines not on this page · raw message

include/configs/rpi_2.h new file +15 -0
new file mode 100644
index 000000000000..2e7e74fd563b
@@ -0,0 +1,15 @@
+/*
+ * (C) Copyright 2012,2015 Stephen Warren
+ *
+ * SPDX-License-Identifier:	GPL-2.0
+ */
+
+#ifndef __CONFIG_H
+#define __CONFIG_H
+
+#define CONFIG_SKIP_LOWLEVEL_INIT
+#define CONFIG_BCM2836
+
+#include "rpi-common.h"
+
+#endif
Signature · 1 line
1.9.1
#6 lore raw

PATCH 3/3 rpi: add support for Raspberry Pi 2 model B

Quoted 9 lines · Stephen Warren

The "get board rev" firmware API doesn't seem to return a useful value on this platform, so we hard-code the board ID for now, since there's only one bcm2836-based RPi board at present.

USB doesn't seem to work yet; the controller detects the on-board Hub/ Ethernet device but can't read the descriptors from it. I haven't investigated yet.

HDMI is untested.

HDMI is now tested, and works fine.