From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: distrokit@pengutronix.de
Subject: [DistroKit] [PATCH 3/5] v7a: Add support for Raspberry Pi CM3
Date: Thu, 11 Mar 2021 19:12:54 +0100 [thread overview]
Message-ID: <20210311181256.180826-3-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20210311181256.180826-1-u.kleine-koenig@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
configs/platform-v7a/barebox-rpi2.config | 2 +-
configs/platform-v7a/barebox-rpi2.config.diff | 1 +
.../platform-v7a/config/images/rpicm3.config | 30 ++++++++++++
configs/platform-v7a/platformconfig | 4 +-
.../platform-v7a/platforms/blspec-rpicm3.in | 5 ++
.../platform-v7a/platforms/image-rpicm3.in | 12 +++++
.../projectroot/loader/entries/rpicm3.conf | 6 +++
configs/platform-v7a/rules/barebox-rpi2.make | 2 +-
configs/platform-v7a/rules/blspec-rpicm3.make | 36 +++++++++++++++
configs/platform-v7a/rules/image-rpicm3.make | 46 +++++++++++++++++++
doc/hardware_v7a_raspi3.rst | 24 +++++++++-
11 files changed, 164 insertions(+), 4 deletions(-)
create mode 100644 configs/platform-v7a/config/images/rpicm3.config
create mode 100644 configs/platform-v7a/platforms/blspec-rpicm3.in
create mode 100644 configs/platform-v7a/platforms/image-rpicm3.in
create mode 100644 configs/platform-v7a/projectroot/loader/entries/rpicm3.conf
create mode 100644 configs/platform-v7a/rules/blspec-rpicm3.make
create mode 100644 configs/platform-v7a/rules/image-rpicm3.make
diff --git a/configs/platform-v7a/barebox-rpi2.config b/configs/platform-v7a/barebox-rpi2.config
index 4535c2963577..f71bd9ea30fd 100644
--- a/configs/platform-v7a/barebox-rpi2.config
+++ b/configs/platform-v7a/barebox-rpi2.config
@@ -57,7 +57,7 @@ CONFIG_MACH_RPI_COMMON=y
# CONFIG_MACH_RPI is not set
CONFIG_MACH_RPI2=y
CONFIG_MACH_RPI3=y
-# CONFIG_MACH_RPI_CM3 is not set
+CONFIG_MACH_RPI_CM3=y
# end of select Broadcom BCM283X boards to be built
CONFIG_BAREBOX_MAX_IMAGE_SIZE=0xffffffff
diff --git a/configs/platform-v7a/barebox-rpi2.config.diff b/configs/platform-v7a/barebox-rpi2.config.diff
index 98f09156371d..6cada6782ea1 100644
--- a/configs/platform-v7a/barebox-rpi2.config.diff
+++ b/configs/platform-v7a/barebox-rpi2.config.diff
@@ -23,6 +23,7 @@ CONFIG_GPIO_RASPBERRYPI_EXP=y
# CONFIG_KEYBOARD_QT1070 is undefined
# CONFIG_LED_PCA955X is undefined
CONFIG_MACH_RPI2=y
+CONFIG_MACH_RPI_CM3=y
CONFIG_MCI_BCM283X=y
CONFIG_MCI_BCM283X_SDHOST=y
# CONFIG_MCI_MMCI is not set
diff --git a/configs/platform-v7a/config/images/rpicm3.config b/configs/platform-v7a/config/images/rpicm3.config
new file mode 100644
index 000000000000..4c10ac4917ca
--- /dev/null
+++ b/configs/platform-v7a/config/images/rpicm3.config
@@ -0,0 +1,30 @@
+image rpicm3-boot.vfat {
+ vfat {
+ files = { @FIRMWARE_RPI3@ }
+ file barebox.img { image = barebox-raspberry-pi-cm3.img }
+ }
+ size = 32M
+}
+
+image @IMAGE@ {
+ hdimage {
+ align = 1M
+ disk-signature = 0xbedf7893
+ }
+ partition boot {
+ image = rpicm3-boot.vfat
+ size = 32M
+ partition-type = 0xc
+ bootable = true
+ }
+ partition root-A {
+ image = root.ext2
+ partition-type = 0x83
+ size = 512M
+ }
+ partition data {
+ partition-type = 0x83
+ size = 512M
+ }
+}
+/* vim: set tabstop=8 noexpandtab : */
diff --git a/configs/platform-v7a/platformconfig b/configs/platform-v7a/platformconfig
index 2ef8b8e87b61..a42e598a14e8 100644
--- a/configs/platform-v7a/platformconfig
+++ b/configs/platform-v7a/platformconfig
@@ -152,7 +152,7 @@ PTXCONF_KERNEL_EXTRA_MAKEVARS=""
PTXCONF_DTC=y
PTXCONF_DTC_INSTALL_OFTREE=y
PTXCONF_DTC_OFTREE_DTS_PATH="${PTXDIST_PLATFORMCONFIG_SUBDIR}/dts:${KERNEL_DIR}/arch/${GENERIC_KERNEL_ARCH}/boot/dts"
-PTXCONF_DTC_OFTREE_DTS="am335x-bone.dts am335x-boneblack.dts vexpress-v2p-ca9.dts bcm2836-rpi-2-b.dts imx6q-sabrelite.dts imx6sx-udoo-neo-full.dts imx6dl-riotboard.dts imx6q-nitrogen6x.dts imx6qp-nitrogen6_max.dts bcm2837-rpi-3-b.dts stm32mp157c-dk2.dts stm32mp157c-lxa-mc1.dts at91-sama5d27_som1_ek.dts at91-sama5d27_giantboard.dts"
+PTXCONF_DTC_OFTREE_DTS="am335x-bone.dts am335x-boneblack.dts vexpress-v2p-ca9.dts bcm2836-rpi-2-b.dts imx6q-sabrelite.dts imx6sx-udoo-neo-full.dts imx6dl-riotboard.dts imx6q-nitrogen6x.dts imx6qp-nitrogen6_max.dts bcm2837-rpi-3-b.dts bcm2837-rpi-cm3-io3.dts stm32mp157c-dk2.dts stm32mp157c-lxa-mc1.dts at91-sama5d27_som1_ek.dts at91-sama5d27_giantboard.dts"
PTXCONF_DTC_EXTRA_ARGS=""
PTXCONF_HOST_DTC=y
PTXCONF_HOST_DTC_VERSION="1.6.0"
@@ -226,6 +226,7 @@ PTXCONF_BLSPEC_NITROGEN6X=y
PTXCONF_BLSPEC_RIOTBOARD=y
PTXCONF_BLSPEC_RPI2=y
PTXCONF_BLSPEC_RPI3=y
+PTXCONF_BLSPEC_RPICM3=y
PTXCONF_BLSPEC_SABRELITE=y
PTXCONF_BLSPEC_SAMA5D27_GIANTBOARD=y
PTXCONF_BLSPEC_SAMA5D27_SOM1_EK=y
@@ -278,6 +279,7 @@ PTXCONF_IMAGE_ROOT_TGZ_LABEL=""
# PTXCONF_IMAGE_ROOT_UBIFS is not set
PTXCONF_IMAGE_RPI2=y
PTXCONF_IMAGE_RPI3=y
+PTXCONF_IMAGE_RPICM3=y
PTXCONF_IMAGE_SABRELITE=y
PTXCONF_IMAGE_SAMA5D27_GIANTBOARD=y
PTXCONF_IMAGE_SAMA5D27_SOM1_EK=y
diff --git a/configs/platform-v7a/platforms/blspec-rpicm3.in b/configs/platform-v7a/platforms/blspec-rpicm3.in
new file mode 100644
index 000000000000..430346cca103
--- /dev/null
+++ b/configs/platform-v7a/platforms/blspec-rpicm3.in
@@ -0,0 +1,5 @@
+## SECTION=blspec
+
+config BLSPEC_RPICM3
+ tristate
+ prompt "/loader/entries/rpicm3.conf bootloader spec entry"
diff --git a/configs/platform-v7a/platforms/image-rpicm3.in b/configs/platform-v7a/platforms/image-rpicm3.in
new file mode 100644
index 000000000000..5cecf9ac00b3
--- /dev/null
+++ b/configs/platform-v7a/platforms/image-rpicm3.in
@@ -0,0 +1,12 @@
+## SECTION=image
+
+config IMAGE_RPICM3
+ tristate
+ select HOST_GENIMAGE
+ select HOST_DOSFSTOOLS
+ select HOST_MTOOLS
+ select IMAGE_ROOT_EXT
+ select BAREBOX_RPI2
+ prompt "Generate images/rpiCM3.hdimg"
+ help
+ SD card image for the Raspberry Pi Compute Module 3
diff --git a/configs/platform-v7a/projectroot/loader/entries/rpicm3.conf b/configs/platform-v7a/projectroot/loader/entries/rpicm3.conf
new file mode 100644
index 000000000000..ada8d993b39a
--- /dev/null
+++ b/configs/platform-v7a/projectroot/loader/entries/rpicm3.conf
@@ -0,0 +1,6 @@
+title Raspberry Pi CM3 - Pengutronix-DistroKit
+version 4.6
+options rootwait rw
+linux /boot/zImage
+devicetree /boot/bcm2837-rpi-cm3-io3.dtb
+linux-appendroot true
diff --git a/configs/platform-v7a/rules/barebox-rpi2.make b/configs/platform-v7a/rules/barebox-rpi2.make
index 5f16584238d7..636ffebf4206 100644
--- a/configs/platform-v7a/rules/barebox-rpi2.make
+++ b/configs/platform-v7a/rules/barebox-rpi2.make
@@ -45,7 +45,7 @@ BAREBOX_RPI2_CONF_OPT := \
BAREBOX_RPI2_MAKE_OPT := $(BAREBOX_RPI2_CONF_OPT)
-BAREBOX_RPI2_IMAGES := images/barebox-raspberry-pi-2.img images/barebox-raspberry-pi-3.img
+BAREBOX_RPI2_IMAGES := images/barebox-raspberry-pi-2.img images/barebox-raspberry-pi-3.img images/barebox-raspberry-pi-cm3.img
BAREBOX_RPI2_IMAGES := $(addprefix $(BAREBOX_RPI2_BUILD_DIR)/,$(BAREBOX_RPI2_IMAGES))
ifdef PTXCONF_BAREBOX_RPI2
diff --git a/configs/platform-v7a/rules/blspec-rpicm3.make b/configs/platform-v7a/rules/blspec-rpicm3.make
new file mode 100644
index 000000000000..4908a8bcb8c5
--- /dev/null
+++ b/configs/platform-v7a/rules/blspec-rpicm3.make
@@ -0,0 +1,36 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2021 by Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_BLSPEC_RPICM3) += blspec-rpicm3
+
+BLSPEC_RPICM3_VERSION := 4.6
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/blspec-rpicm3.targetinstall:
+ @$(call targetinfo)
+
+ @$(call install_init, blspec-rpicm3)
+ @$(call install_fixup,blspec-rpicm3,PRIORITY,optional)
+ @$(call install_fixup,blspec-rpicm3,SECTION,base)
+ @$(call install_fixup,blspec-rpicm3,AUTHOR,"Uwe Kleine-König <u.kleine-koenig@pengutronix.de>")
+ @$(call install_fixup,blspec-rpicm3,DESCRIPTION,missing)
+
+ @$(call install_alternative, blspec-rpicm3, 0, 0, 0644, \
+ /loader/entries/rpicm3.conf)
+
+ @$(call install_finish,blspec-rpicm3)
+
+ @$(call touch)
+
+# vim: syntax=make
diff --git a/configs/platform-v7a/rules/image-rpicm3.make b/configs/platform-v7a/rules/image-rpicm3.make
new file mode 100644
index 000000000000..81cdd262252a
--- /dev/null
+++ b/configs/platform-v7a/rules/image-rpicm3.make
@@ -0,0 +1,46 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Sascha Hauer <s.hauer@pengutronix.de>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+IMAGE_PACKAGES-$(PTXCONF_IMAGE_RPICM3) += image-rpicm3
+
+#
+# Paths and names
+#
+IMAGE_RPICM3 := image-rpicm3
+IMAGE_RPICM3_DIR := $(BUILDDIR)/$(IMAGE_RPICM3)
+IMAGE_RPICM3_IMAGE := $(IMAGEDIR)/rpicm3.hdimg
+IMAGE_RPICM3_FILES := $(IMAGEDIR)/root.tgz
+IMAGE_RPICM3_CONFIG := rpicm3.config
+IMAGE_RPICM3_DATA_DIR := $(call ptx/in-platformconfigdir, rpi-firmware)
+IMAGE_RPICM3_DATA := \
+ $(wildcard $(IMAGE_RPICM3_DATA_DIR)/*.bin) \
+ $(wildcard $(IMAGE_RPICM3_DATA_DIR)/*.elf) \
+ $(wildcard $(IMAGE_RPICM3_DATA_DIR)/*.dat) \
+ $(wildcard $(IMAGE_RPICM3_DATA_DIR)/*.dtb) \
+ $(wildcard $(IMAGE_RPICM3_DATA_DIR)/config.txt)
+
+# ----------------------------------------------------------------------------
+# Image
+# ----------------------------------------------------------------------------
+
+define squote_and_comma
+$(subst $(ptx/def/space),$(comma) ,$(addsuffix $(ptx/def/squote),$(addprefix $(ptx/def/squote),$(1))))
+endef
+
+IMAGE_RPICM3_ENV := \
+ FIRMWARE_RPI3="$(call squote_and_comma,$(IMAGE_RPICM3_DATA))"
+
+$(IMAGE_RPICM3_IMAGE):
+ @$(call targetinfo)
+ @$(call image/genimage, IMAGE_RPICM3)
+ @$(call finish)
+
+# vim: syntax=make
diff --git a/doc/hardware_v7a_raspi3.rst b/doc/hardware_v7a_raspi3.rst
index d8742332f0e9..a4069c2998aa 100644
--- a/doc/hardware_v7a_raspi3.rst
+++ b/doc/hardware_v7a_raspi3.rst
@@ -7,9 +7,31 @@ Use the image ``platform-v7a/images/rpi3.hdimg`` and copy it onto your MicroSD-C
Serial Console
--------------
-The serial boot console is available at J8 (the GPIO header) with 115200 Baud and 8N1 on the following Pins:
+The serial boot console is available at J8 (the GPIO header) with 115200 Baud and 8N1 on the following pins:
* J8.6: GND
* J8.8: Tx
* J8.10: Rx
+Raspberry Pi Compute Module 3+
+==============================
+
+Boot Media
+----------
+Use the image ``platform-v7a/images/rpicm3.hdimg`` and copy it onto your MicroSD-Card.
+
+If you have a hardware with eMMC the uSD slot is not functional, in this case
+you have to use `usbboot <https://github.com/raspberrypi/usbboot`_ to switch
+the hardware into USB mass storage mode. See their documentation and
+`"Flashing the Compute Module eMMC" at raspberrypi.org
+<https://www.raspberrypi.org/documentation/hardware/computemodule/cm-emmc-flashing.md>`
+for details.
+
+Serial Console
+--------------
+The serial boot console is available at the GPIOx BANK0 header (J5) on the following pins with the Compute Module IO Board V3.0:
+
+* GPIO14: TX
+* GPIO15: RX
+
+For GND there are several labeled pins available on J5.
--
2.30.1
_______________________________________________
DistroKit mailing list
DistroKit@pengutronix.de
next prev parent reply other threads:[~2021-03-11 18:12 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-11 18:12 [DistroKit] [PATCH 1/5] v7a: stm32mp: images: allow differing board names for FSBL and SSBL Uwe Kleine-König
2021-03-11 18:12 ` [DistroKit] [PATCH 2/5] v7a: barebox update 2020.09.0 -> 2021.02.0 Uwe Kleine-König
2021-03-11 18:36 ` Robert Schwebel
2021-03-11 18:12 ` Uwe Kleine-König [this message]
2021-03-11 18:37 ` [DistroKit] [PATCH 3/5] v7a: Add support for Raspberry Pi CM3 Robert Schwebel
2021-03-11 18:12 ` [DistroKit] [PATCH 4/5] v7a/kernel: Enable driver for usb ethernet dongles AX8817X Uwe Kleine-König
2021-03-11 18:37 ` Robert Schwebel
2021-03-11 18:12 ` [DistroKit] [PATCH 5/5] v7a/barebox: Enable commands of_fixup_status and of_overlay Uwe Kleine-König
2021-03-11 18:37 ` Robert Schwebel
2021-03-11 18:36 ` [DistroKit] [PATCH 1/5] v7a: stm32mp: images: allow differing board names for FSBL and SSBL Robert Schwebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210311181256.180826-3-u.kleine-koenig@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=distrokit@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox