From 3bea5366de93d48422300624345d776bcda2fdbd Mon Sep 17 00:00:00 2001 From: Neeraj Dantu Date: Thu, 3 Mar 2022 11:55:23 -0600 Subject: [PATCH] Add BRK board to Debian SDK --- Makefile | 74 ++++--- README.md | 54 ++--- files/demo_brk/LEDWebDemo/LEDWebServer.py | 136 ++++++++++++ files/demo_brk/LEDWebDemo/brkLed.py | 208 ++++++++++++++++++ files/demo_brk/LEDWebDemo/ledTemplate.html | 37 ++++ .../OSD32MP1_RED_intro_360p.mp4 | Bin files/{ => demo_red}/demo_camera.sh | 0 files/{ => demo_red}/demo_video.sh | 0 files/fsbl/Makefile.sdk | 10 +- ...mc => fstab_emmc_stm32mp157c-osd32mp1-red} | 0 .../fstab_sdcard_stm32mp157c-osd32mp1-brk | 7 + ... => fstab_sdcard_stm32mp157c-osd32mp1-red} | 0 files/ssbl/Makefile.sdk | 2 +- ...Add-OSD32MP1-RED-Device-tree-support.patch | 36 ++- stm32mp157c-osd32mp1-brk-extlinux.sh | 56 +++++ 15 files changed, 543 insertions(+), 77 deletions(-) create mode 100644 files/demo_brk/LEDWebDemo/LEDWebServer.py create mode 100644 files/demo_brk/LEDWebDemo/brkLed.py create mode 100644 files/demo_brk/LEDWebDemo/ledTemplate.html rename files/{ => demo_red}/OSD32MP1_RED_intro_360p.mp4 (100%) rename files/{ => demo_red}/demo_camera.sh (100%) rename files/{ => demo_red}/demo_video.sh (100%) rename files/rootfs/{fstab_emmc => fstab_emmc_stm32mp157c-osd32mp1-red} (100%) create mode 100644 files/rootfs/fstab_sdcard_stm32mp157c-osd32mp1-brk rename files/rootfs/{fstab_sdcard => fstab_sdcard_stm32mp157c-osd32mp1-red} (100%) create mode 100755 stm32mp157c-osd32mp1-brk-extlinux.sh diff --git a/Makefile b/Makefile index 5f37bab..c9b926c 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,7 @@ ATF_VERSION=arm-trusted-firmware-2.4 UBOOT_VERSION = u-boot-2020.10 KERNEL_VERSION=linux-5.10 GCNANO_VERSION=6.4.3 +GCNANO_SUBVERSION=20200902 FSBL_DIR ?= $(realpath bootloader/$(ATF_VERSION)) SSBL_DIR ?= $(realpath bootloader/$(UBOOT_VERSION)) @@ -16,15 +17,18 @@ MULTISTRAP_DIR ?= $(realpath multistrap) ROOTFS_DIR ?= $(MULTISTRAP_DIR)/multistrap-debian-bullseye GCNANO_DIR ?= $(realpath gcnano-$(GCNANO_VERSION).binaries) GCNANO_DRV_DIR ?= $(GCNANO_DIR)/gcnano-driver-$(GCNANO_VERSION) -GCNANO_USR_DIR ?= $(GCNANO_DIR)/gcnano-userland-multi-$(GCNANO_VERSION)-* +GCNANO_USR_DIR ?= $(GCNANO_DIR)/gcnano-userland-multi-$(GCNANO_VERSION)-$(GCNANO_SUBVERSION) M4PROJECTS_DIR ?= $(realpath STM32CubeMP1) DEPLOY_DIR ?= $(PWD)/deploy BUILDTOOLS_DIR ?= $(realpath build-tools) MODE ?= trusted -#MODE ?= basic BOARD_NAME := stm32mp157c-osd32mp1-red KDEFCONFIG ?= multi_v7_defconfig +BOOT_EMMC = 1 +BOOT_SD = 1 +BOARD_RED = stm32mp157c-osd32mp1-red +BOARD_BRK = stm32mp157c-osd32mp1-brk ARCH ?= arm CROSS_COMPILE ?= arm-linux-gnueabihf- @@ -78,12 +82,18 @@ setup: patch --ignore-whitespace $(DEPLOY_DIR)/create_sdcard_from_flashlayout.sh $(BUILDTOOLS_DIR)/files/flash-tools/sdcard-script.patch # First stage bootloader +# Add to if statement for custom board fsbl: setup patch_fsbl cp $(BUILDTOOLS_DIR)/files/fsbl/Makefile.sdk $(FSBL_DIR) PWD=$(FSBL_DIR) $(MAKE) $(FLAGS) -C $(FSBL_DIR) -f Makefile.sdk stm32 - cp $(FSBL_DIR)/deploy/tf-a-$(BOARD_NAME)-sdcard.stm32 $(DEPLOY_DIR) - cp $(FSBL_DIR)/deploy/tf-a-$(BOARD_NAME)-emmc.stm32 $(DEPLOY_DIR) cp $(FSBL_DIR)/deploy/tf-a-$(BOARD_NAME)-usb.stm32 $(DEPLOY_DIR) + if [ "$(BOOT_SD)" -eq "1" ]; then \ + cp $(FSBL_DIR)/deploy/tf-a-$(BOARD_NAME)-sdcard.stm32 $(DEPLOY_DIR); \ + fi + if [ "$(BOOT_EMMC)" -eq "1" ]; then \ + cp $(FSBL_DIR)/deploy/tf-a-$(BOARD_NAME)-emmc.stm32 $(DEPLOY_DIR); \ + fi + # Second stage bootloader ssbl: setup fsbl patch_ssbl @@ -142,7 +152,7 @@ rootfs: kernel gcnano m4_demo mkdir -p $(ROOTFS_DIR)/lib/firmware/brcm/ cp $(BUILDTOOLS_DIR)/files/firmwares/CYW43430A1.1DX.hcd $(ROOTFS_DIR)/lib/firmware/brcm/BCM43430A1.hcd cp $(BUILDTOOLS_DIR)/files/firmwares/LICENCE.cypress $(ROOTFS_DIR)/lib/firmware/LICENCE.cypress_bcm4343 - cp $(BUILDTOOLS_DIR)/files/firmwares/brcmfmac43430-sdio.txt $(ROOTFS_DIR)/lib/firmware/brcm/ + cp $(BUILDTOOLS_DIR)/files/firmwares/brcmfmac43430-sdio.txt $(ROOTFS_DIR)/lib/firmware/brcm/brcmfmac43430-sdio.octavo,stm32mp157c-osd32mp1-red.txt cp $(BUILDTOOLS_DIR)/files/firmwares/brcmfmac43430-sdio.bin $(ROOTFS_DIR)/lib/firmware/brcm/ cp $(BUILDTOOLS_DIR)/files/firmwares/brcmfmac43430-sdio.1DX.clm_blob $(ROOTFS_DIR)/lib/firmware/brcm/brcmfmac43430-sdio.clm_blob @@ -157,25 +167,36 @@ rootfs: kernel gcnano m4_demo sed -i -e "s:@userfs_mount_point@:${STM32MP_USERFS_MOUNTPOINT_IMAGE}:" $(ROOTFS_DIR)/sbin/st-m4firmware-load-default.sh cp $(M4PROJECTS_DIR)/st-m4firmware-load.service $(ROOTFS_DIR)/lib/systemd/system/ - # Install demo files - cp $(BUILDTOOLS_DIR)/files/demo_camera.sh $(ROOTFS_DIR)/home/debian - cp $(BUILDTOOLS_DIR)/files/demo_video.sh $(ROOTFS_DIR)/home/debian - cp $(BUILDTOOLS_DIR)/files/OSD32MP1_RED_intro_360p.mp4 $(ROOTFS_DIR)/home/debian + # Install demo files for OSD32MP1-RED +ifeq ($(BOARD_NAME), $(BOARD_RED)) + cp $(BUILDTOOLS_DIR)/files/demo_red/demo_camera.sh $(ROOTFS_DIR)/home/debian; \ + cp $(BUILDTOOLS_DIR)/files/demo_red/demo_video.sh $(ROOTFS_DIR)/home/debian; \ + cp $(BUILDTOOLS_DIR)/files/demo_red/OSD32MP1_RED_intro_360p.mp4 $(ROOTFS_DIR)/home/debian; +endif + + # Instll demo files for OSD32MP1-BRK +ifeq ($(BOARD_NAME), $(BOARD_BRK)) + mkdir -p $(ROOTFS_DIR)/usr/local/demo/; \ + cp -R $(BUILDTOOLS_DIR)/files/demo_brk/LEDWebDemo/ $(ROOTFS_DIR)/usr/local/demo/; +endif + + # Install M4 demo firmware cp -R $(M4PROJECTS_DIR)/deploy/STM32MP157C-DK2 $(ROOTFS_DIR)/usr/local/bin/ - # Install fstab for emmc - cp $(BUILDTOOLS_DIR)/files/rootfs/fstab_emmc $(ROOTFS_DIR)/etc/fstab + if [ $(BOOT_EMMC) -eq 1 ]; then \ + cp $(BUILDTOOLS_DIR)/files/rootfs/fstab_emmc_$(BOARD_NAME) $(ROOTFS_DIR)/etc/fstab; \ + tar -cf $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-emmc-$(BOARD_NAME).tar -C $(ROOTFS_DIR) .; \ + virt-make-fs --type=ext4 --size=+$(ROOTFS_EXTRA_SPACE)M $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-emmc-$(BOARD_NAME).tar $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-emmc-$(BOARD_NAME).ext4; \ + fi + + if [ $(BOOT_SD) -eq 1 ]; then \ + cp $(BUILDTOOLS_DIR)/files/rootfs/fstab_sdcard_$(BOARD_NAME) $(ROOTFS_DIR)/etc/fstab; \ + tar -cf $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-sdcard-$(BOARD_NAME).tar -C $(ROOTFS_DIR) .; \ + virt-make-fs --type=ext4 --size=+$(ROOTFS_EXTRA_SPACE)M $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-sdcard-$(BOARD_NAME).tar $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-sdcard-$(BOARD_NAME).ext4; \ + fi - # Create eMMC image - tar -cf $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-emmc-$(BOARD_NAME).tar -C $(ROOTFS_DIR) . - virt-make-fs --type=ext4 --size=+$(ROOTFS_EXTRA_SPACE)M $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-emmc-$(BOARD_NAME).tar $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-emmc-$(BOARD_NAME).ext4 - # Install fstab for sd card - cp $(BUILDTOOLS_DIR)/files/rootfs/fstab_sdcard $(ROOTFS_DIR)/etc/fstab - # Create SD card image - tar -cf $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-sdcard-$(BOARD_NAME).tar -C $(ROOTFS_DIR) . - virt-make-fs --type=ext4 --size=+$(ROOTFS_EXTRA_SPACE)M $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-sdcard-$(BOARD_NAME).tar $(DEPLOY_DIR)/octavo-rootfs-debian-lxqt-sdcard-$(BOARD_NAME).ext4 vendorfs: setup gcnano @@ -195,11 +216,14 @@ m4_demo: setup cd $(M4PROJECTS_DIR) ; ./build_m4projects.sh; \ fi -image: - rm -rf $(DEPLOY_DIR)/FlashLayout_sdcard_$(BOARD_NAME)-$(MODE).raw - $(DEPLOY_DIR)/generate_tsv.sh -b $(BOARD_NAME) -m $(MODE) -d 0 - $(DEPLOY_DIR)/generate_tsv.sh -b $(BOARD_NAME) -m $(MODE) -d 1 - $(DEPLOY_DIR)/create_sdcard_from_flashlayout.sh $(DEPLOY_DIR)/FlashLayout_sdcard_$(BOARD_NAME)-$(MODE).tsv $(SDCARD_SIZE_GB) +image: fsbl ssbl bootfs rootfs vendorfs + if [ $(BOOT_SD) -eq 1 ]; then \ + $(DEPLOY_DIR)/generate_tsv.sh -b $(BOARD_NAME) -m $(MODE) -d 0; \ + $(DEPLOY_DIR)/create_sdcard_from_flashlayout.sh $(DEPLOY_DIR)/FlashLayout_sdcard_$(BOARD_NAME)-$(MODE).tsv $(SDCARD_SIZE_GB); \ + fi + if [ $(BOOT_EMMC) -eq 1 ]; then \ + $(DEPLOY_DIR)/generate_tsv.sh -b $(BOARD_NAME) -m $(MODE) -d 1; \ + fi all: ssbl fsbl bootfs rootfs vendorfs image @@ -224,8 +248,8 @@ kernel_clean: clean: ssbl_clean fsbl_clean kernel_clean $(MAKE) $(FLAGS) -C $(MULTISTRAP_DIR) clean @rm -rf $(GCNANO_DRV_DIR) - @rm -rf $(GCNANO_USR_DIR) @rm -rf $(GCNANO_DRV_DIR)/galcore.ko @rm -rf $(DEPLOY_DIR) @rm -rf $(ROOTFS_DIR) + @rm -rf $(GCNANO_USR_DIR) diff --git a/README.md b/README.md index 02035e2..91dcc8d 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# OSD32MP1 Debian SDK: OSD32MP1-build-tools -This repository contains the build tools used for OSD32MP1 Debian SDK +# OSD32MP1 Debian SDK v3.0 +This repository contains the list of repositories used for OSD32MP1 Debian SDK v3.0 ## Introduction -OSD32MP1 Debian SDK can be used to develop Debian Linux images for OSD32MP1 based platforms. The SDK runs on host desktop preferably runnning Ubuntu. Docker is used to containerize the build environment. Souce code from ST (OpenSTLinux) is used, for TF-A, U-Boot, Linux kernel, GCNano and STM32CubeMP1. So, the SDK is compatible with software from ST. Binary images for both SD card or eMMC can be generated. Cube Programmer can be used to flash the eMMC via USB. +OSD32MP1 Debian SDK can be used to develop Debian Linux images for OSD32MP1 based platforms. The SDK runs on host desktop preferably runnning Ubuntu. Docker is used to containerize the build environment. Souce code from ST (OpenSTLinux) is used, for TF-A, U-Boot, Linux kernel, GCNano and STM32CubeMP1. So, the SDK is compatible with software from ST. Binary images for both SD card and eMMC can be generated. Cube Programmer can be used to flash the eMMC via USB. The following repositories make up OSD32MP1 Debian SDK:: @@ -13,7 +13,7 @@ The following repositories make up OSD32MP1 Debian SDK:: | Linux kernel Source code | https://github.com/STMicroelectronics/linux.git | | GCNano Binaries | https://github.com/STMicroelectronics/gcnano-binaries.git | | STM32Cube MP1 Package | https://github.com/STMicroelectronics/STM32CubeMP1.git | -| Debian multistrap Source code | https://github.com/octavosystems/osd32mp1-multistrap-buster.git | +| Debian multistrap Source code | https://github.com/octavosystems/osd32mp1-multistrap.git | | Docker image Source code | https://github.com/octavosystems/osd32mp1-debian-docker.git | | Build tools source code | https://github.com/octavosystems/osd32mp1-build-tools.git | @@ -23,7 +23,7 @@ The following repositories make up OSD32MP1 Debian SDK:: | OSD32MP1-RED | https://octavosystems.com/octavo_products/osd32mp1-red/ | ## Requirements -Tested on Ubuntu 18.04 LTS +Tested on Ubuntu 20.04 LTS The following packges are recommended: @@ -33,8 +33,8 @@ The following packges are recommended: | git | 2.17 or higher| | Python | 3.x | | Docker | 19.x | -| qemu-user-static | v5.4-stm32mp | -| STM32MP1 Cube Programmer | 2.5 or higher| +| qemu-user-static | 1:4.2-3ubuntu6.19 | +| STM32MP1 Cube Programmer | 2.9 or higher| ## OSD32MP1 Target binary versions: @@ -43,19 +43,20 @@ The following version of the image are supported in release: | Package | Version | Source URL | | ------- | ------- | ---------- | -| TF-A | v2.0-stm32mp-r1.5 | https://github.com/STMicroelectronics/arm-trusted-firmware.git | -| U-Boot | v2018.11-stm32mp-r3 | https://github.com/STMicroelectronics/u-boot.git | -| Linux Kernel | v4.19-stm32mp-r3 | https://github.com/STMicroelectronics/linux.git | -| GCNano(binaries) | gcnano-6.2.4_p4-binaries | https://github.com/STMicroelectronics/gcnano-binaries.git | -| STM32CubeMP1 | 1.2 | https://github.com/STMicroelectronics/STM32CubeMP1.git | +| TF-A | v2.4-stm32mp-r1 | https://github.com/STMicroelectronics/arm-trusted-firmware.git | +| U-Boot | 2020.10-stm32mp-r1 | https://github.com/STMicroelectronics/u-boot.git | +| Linux Kernel | v5.10-stm32mp-r1 | https://github.com/STMicroelectronics/linux.git | +| GCNano(binaries) | gcnano-6.4.3-binaries | https://github.com/STMicroelectronics/gcnano-binaries.git | +| STM32CubeMP1 | 1.4 | https://github.com/STMicroelectronics/STM32CubeMP1.git | ## How to use the SDK ### Setup Host computer 1. ```sudo apt-get update``` 2. ```sudo apt-get upgrade``` -3. ```sudo apt-get install git docker.io repo qemu-user-static``` +3. ```sudo apt-get install git docker.io qemu-user-static``` 4. ```sudo systemctl enable docker``` 5. ```sudo systemctl start docker``` +6. Install repo: https://stackoverflow.com/questions/4350344/how-to-install-androids-repo-on-my-ubuntu-system Install Cube Programmer from here: https://www.st.com/en/development-tools/stm32cubeprog.html Please see https://wiki.st.com/stm32mpu/wiki/STM32CubeProgrammer for Cube Programmer installation instructions and setup. @@ -80,20 +81,21 @@ The following outputs are generated in ~/osd32mp1-workspace/deploy : | Output | Filename | Comment | | ------ | -------- | ------- | -| 1 | tf-a-osd32mp1-red.stm32 | Binary for OSD32M1 arm-trusted-firmware | -| 2 | tf-a-osd32mp1-red-trusted.stm32 | Binary for OSD32MP1 arm-trsuted-firmware | -| 3 | u-boot-osd32mp1-red-trusted.stm32 | Binary for OSD32MP1 U-Boot | -| 4 | FlashLayout_sdcard_osd32mp1-red-trusted.tsv | Flash layout file for OSD32MP1-RED trusted - SD card | -| 5 | FlashLayout_sdcard_osd32mp1-red-trusted.raw | Binary image for OSD32MP1-RED trusted - SD card | -| 6 | FlashLayout_emmc_osd32mp1-red-trusted.tsv | Flash layout file for OSD32MP1-RED trsudted - eMMC | -| 7 | octavo-bootfs-debian-lxqt-osd32mp1-red.ext4 | BOOTFS binary for OSD32MP1-RED | -| 8 | octavo-rootfs-debian-lxqt-emmc-osd32mp1-red.ext4 | ROOTFS binary for OSD32MP1-RED - eMMC | -| 9 | octavo-rootfs-debian-lxqt-sdcard-osd32mp1-red.ext4 | ROOTFS binary for OSD32MP1-RED - SD card | -| 10 | octavo-vendorfs-debian-lxqt-osd32mp1-red.ext4 | VENDORFS binary for OSD32MP1-RED | +| 1 | tf-a-stm32mp157c-osd32mp1-red-emmc.stm32 | Binary for OSD32M1 arm-trusted-firmware eMMC | +| 2 | tf-a-stm32mp157c-osd32mp1-red-sdcard.stm32 | Binary for OSD32MP1 arm-trsuted-firmware SD card | +| 3 | tf-a-stm32mp157c-osd32mp1-red-usb.stm32 | Binary for OSD32MP1 arm-trsuted-firmware SD card USB boot | +| 4 | fip-stm32mp157c-osd32mp1-red-trusted.bin | FiP Binary for OSD32MP1 U-Boot | +| 4 | FlashLayout_sdcard_stm32mp157c-osd32mp1-red-trusted.tsv | Flash layout file for OSD32MP1-RED trusted - SD card | +| 5 | FlashLayout_sdcard_stm32mp157c-osd32mp1-red-trusted.raw | Binary image for OSD32MP1-RED trusted - SD card | +| 6 | FlashLayout_emmc_stm32mp157c-osd32mp1-red-trusted.tsv | Flash layout file for OSD32MP1-RED trsudted - eMMC | +| 7 | octavo-bootfs-debian-lxqt-stm32mp157c-osd32mp1-red.ext4 | BOOTFS binary for OSD32MP1-RED | +| 8 | octavo-rootfs-debian-lxqt-emmc-stm32mp157c-osd32mp1-red.ext4 | ROOTFS binary for OSD32MP1-RED - eMMC | +| 9 | octavo-rootfs-debian-lxqt-sdcard-stm32mp157c-osd32mp1-red.ext4 | ROOTFS binary for OSD32MP1-RED - SD card | +| 10 | octavo-vendorfs-debian-lxqt-stm32mp157c-osd32mp1-red.ext4 | VENDORFS binary for OSD32MP1-RED | ### Deploy on SD card (where sdX is the device assignment for SD card) 1. ```cd ~/osd32mp1-workspace/deploy/``` -2. ```sudo dd if=FlashLayout_sdcard_osd32mp1-red-trusted.raw of=/dev/sdX bs=1M conv=fdatasync status=progress``` +2. ```sudo dd if=FlashLayout_sdcard_stm32mp157c-osd32mp1-red-trusted.raw of=/dev/sdX bs=1M conv=fdatasync status=progress``` ### Flash eMMC STM32MP1 Cube Programmer is required for this procedure @@ -105,7 +107,7 @@ To determine device numnber for the board connected: 3. ```STM32_Programmer_CLI -l USB```
      -------------------------------------------------------------------
-                        STM32CubeProgrammer v2.5.0                  
+                        STM32CubeProgrammer v2.9.0                  
       -------------------------------------------------------------------
 
 =====  DFU Interface   =====
@@ -125,7 +127,7 @@ The above device indicates the board is connected as USB1.
 
 Flash the eMMC
 
-4. ```STM32_Programmer_CLI -c port=USB1 -w FlashLayout_emmc_osd32mp1-red-trusted.tsv```
+4. ```STM32_Programmer_CLI -c port=USB1 -w FlashLayout_emmc_stm32mp157c-osd32mp1-red-trusted.tsv```
 
 
 ## How to contribute
diff --git a/files/demo_brk/LEDWebDemo/LEDWebServer.py b/files/demo_brk/LEDWebDemo/LEDWebServer.py
new file mode 100644
index 0000000..f3a1e07
--- /dev/null
+++ b/files/demo_brk/LEDWebDemo/LEDWebServer.py
@@ -0,0 +1,136 @@
+"""
+--------------------------------------------------------------------------
+Octavo Systems - OSD33MP157c-BRK Demo
+--------------------------------------------------------------------------
+License:
+Copyright 2020 - Octavo Systems LLC
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its contributors
+may be used to endorse or promote products derived from this software without
+specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+--------------------------------------------------------------------------
+This file was modifed from the tutorial found here:
+https://www.e-tinkers.com/2018/04/how-to-control-raspberry-pi-gpio-via-http-web-server/
+
+It is a simple webserver used to display a single page and interact with the I/O
+--------------------------------------------------------------------------
+"""
+import os
+from http.server import BaseHTTPRequestHandler, HTTPServer
+from urllib.parse import urlparse, parse_qs
+
+#the actual hardware interface
+import brkLed
+
+host_name = ''  # bind to all interfaces
+host_port = 8080
+
+
+class MyServer(BaseHTTPRequestHandler):
+    """ A special implementation of BaseHTTPRequestHander for reading data from
+        and control GPIO of the OSD32MP1-BRK
+    """
+
+    def do_HEAD(self):
+        """ do_HEAD() can be tested use curl command
+            'curl -I http://server-ip-address:port'
+        """
+        self.send_response(200)
+        self.send_header('Content-type', 'text/html')
+        self.end_headers()
+
+    def _redirect(self, path):
+        self.send_response(303)
+        self.send_header('Content-type', 'text/html')
+        self.send_header('Location', path)
+        self.end_headers()
+
+    def do_GET(self):
+        """ do_GET() can be tested using curl command
+            'curl http://server-ip-address:port'
+        """
+        # load the HTML template
+        html = self.fileToStr('ledTemplate.html')
+        # get the status of the D1 Green LED
+        d1g_status = brkLed.ledStatus("d1g")
+        d1g_disabled = self.setDisabled(d1g_status)
+
+        # get the status of the D1 RED LED
+        d1r_status = brkLed.ledStatus("d1r")
+        d1r_disabled = self.setDisabled(d1r_status)
+
+        # get the status of the D2 Green LED
+        d2g_status = brkLed.ledStatus("d2g")
+        d2g_disabled = self.setDisabled(d2g_status)
+
+        self.do_HEAD()
+        #return the completed  template
+        self.wfile.write(html.format(**locals()).encode("utf-8"))
+
+    def fileToStr(self, fileName):
+        """Return a string containing the contents of the named file."""
+        fin = open(fileName);
+        contents = fin.read();
+        fin.close()
+        return contents
+
+    def setDisabled(self, status):
+        """
+        returns a list to diable the appropriate button based on the status
+        :param status: that current status
+        :return: a list with the appropraite strings to disable the correct button given the status
+        """
+        if status =="OFF":
+            return ["disabled", "", ""]
+        if status == "ON":
+            return ["", "disabled", ""]
+        if status =="FLASHING":
+            return ["", "", "disabled"]
+
+    def do_POST(self):
+        """ do_POST() can be tested using curl command
+            'curl -d "submit=On" http://server-ip-address:port'
+        """
+        #get the POST agruments and parse them
+        content_length = int(self.headers['Content-Length'])  # Get the size of data
+        post_data = self.rfile.read(content_length).decode("utf-8")  # Get the data
+        post_data = parse_qs(post_data)
+
+        #pass the appropriate parameters based on which button was pressed
+        if "d1g" in post_data:
+            brkLed.ledSET("d1g", post_data["d1g"][0].lower())
+        elif "d1r" in post_data:
+            brkLed.ledSET("d1r", post_data["d1r"][0].lower())
+        elif "d2g" in post_data:
+            brkLed.ledSET("d2g", post_data["d2g"][0].lower())
+
+        self._redirect('/')  # Redirect back to the root url'''
+
+if __name__ == '__main__':
+    #Reset all of the LEDs
+    brkLed.ledRest()
+
+    http_server = HTTPServer((host_name, host_port), MyServer)
+    print("Server Starts - %s:%s" % (host_name, host_port))
+
+    try:
+        http_server.serve_forever()
+    except KeyboardInterrupt:
+        http_server.server_close()
+
diff --git a/files/demo_brk/LEDWebDemo/brkLed.py b/files/demo_brk/LEDWebDemo/brkLed.py
new file mode 100644
index 0000000..9e98fb7
--- /dev/null
+++ b/files/demo_brk/LEDWebDemo/brkLed.py
@@ -0,0 +1,208 @@
+"""
+--------------------------------------------------------------------------
+Octavo Systems - OSD33MP157c-BRK Demo
+--------------------------------------------------------------------------
+License:
+Copyright 2020 - Octavo Systems LLC
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+1. Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+3. Neither the name of the copyright holder nor the names of its contributors
+may be used to endorse or promote products derived from this software without
+specific prior written permission.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+--------------------------------------------------------------------------
+This file contains the physical interfaces to the OSD32MP1-BRK User LEDs
+It provides basic functions like on, off, and blink
+--------------------------------------------------------------------------
+"""
+import os
+import subprocess
+import time
+import threading
+
+# ------------------------------------------------------------------------
+# Constants
+# ------------------------------------------------------------------------
+
+# Command
+GPIO_SET                = "echo {1} > /sys/class/leds/{0}/brightness"
+GPIO_GET                = "cat /sys/class/leds/{0}/brightness"
+
+LED_ON                  = "255"
+LED_OFF                 = "0"
+
+
+# ------------------------------------------------------------------------
+# Global variables
+# ------------------------------------------------------------------------
+
+debug                   = True
+
+#LED GPIO definitions
+D1G                     = "LED1_GRN"
+D1R                     = "LED1_RED"
+D2G                     = "LED2_GRN"
+
+#Dictionary that maps the LED string name to the actual GPIO and its status, and if it is Flashing
+LEDS                    = {"d1g" : [D1G, LED_OFF, False],
+                           "d1r" : [D1R, LED_OFF, False],
+                           "d2g" : [D2G, LED_OFF, False]}
+
+# ------------------------------------------------------------------------
+# Basic On and Off and Status Functions
+# ------------------------------------------------------------------------
+def ledRest():
+    '''funtion that resets all of the LEDs to the default state LED_OFF'''
+
+    for led in LEDS.keys():
+        ledOFF(led)
+
+def ledStatus(led):
+    '''
+    returns the status of the LED in a String
+    :param led: the string that represnets the LED
+    :return: a string representating the status of the LED
+            On, Off, Flashing.  Returns Off if the led is not valid
+    '''
+    #make sure the LED is in the dictionary
+    if led in LEDS:
+
+        # see if it is flashing
+        if LEDS[led][2] == True:
+            return "FLASHING"
+
+        #get the status
+        status = LEDS[led][1]
+
+        #return the appropriate string
+        if status == LED_ON:
+            return "ON"
+        elif status == LED_OFF:
+            return  "OFF"
+    #else return off
+    return "OFF"
+
+def setLED(led, value):
+    """
+    Function that physically sets the GPIO
+    :param led: the string for the LED
+    :param value: the value to set the gpio to
+    :return: True if successfull otherwise False
+    """
+    # make sure the LED is in the dictionary
+    if led in LEDS:
+        # actually set the GPIO pin to the appropriate value
+        os.popen(GPIO_SET.format(LEDS[led][0], value))
+        return  True
+    return False
+
+def ledON(led):
+    '''
+    Turns on the specified LED
+    :param led: string representing the LED
+    :return: True if the LED is set False otherwise
+    '''
+    # make sure the led is in the dictionary
+    if led in LEDS:
+        # set the flashing to False to stop flashing
+        LEDS[led][2] = False
+
+        # set the led to ON
+        if setLED(led, LED_ON):
+            LEDS[led][1] = LED_ON
+            return True
+
+    return False
+
+
+def ledOFF(led):
+    '''
+    Turns off the specified LED
+    :param led: string representing the LED
+    :return: True if the LED is set False otherwise
+    '''
+    # make sure the led is in the dictionary
+    if led in LEDS:
+        #set the flashing variable to false to stop flashing
+        LEDS[led][2] = False
+
+        #set the LED to off
+        if setLED(led, LED_OFF):
+            LEDS[led][1] = LED_OFF
+            return True
+    return False
+
+def ledFLASH(led):
+    """
+    A function that starts flashing the specified LED
+    :param led: the LED to flash
+    :return: True is succcessful false otherwise
+    """
+    #make sure the led is in the dictionary
+    if led in LEDS:
+        # set the flashing variable to True
+        LEDS[led][2] = True
+        #try to start the flashing thread
+        try:
+              th = threading.Thread(target=_flashThread, args=(led, .5))
+              th.start()
+              return True
+        except:
+            #if it fails return False
+            LEDS[led][2] = False
+            return False
+
+def _flashThread(led, duration = 1):
+    """
+    Helper function that is used in a thread to actually flash the specified led
+    :param led: the led to flash
+    :param duration: the time in seconds to wait in between switching modes.  Default is 1 second
+    :return: nothing
+    """
+    # while the flashing variable is true
+    while LEDS[led][2]:
+        #make sure the flashing variable is still true.  Somebody might have changed it since we last checked
+        if LEDS[led][2]:
+            # turn the LED on
+            setLED(led, LED_ON)
+        #sleep for the duration
+        time.sleep(duration)
+        # make sure the flashing variable is still true.  Somebody might have changed it since we last checked
+        if LEDS[led][2]:
+            # turn the LED off
+            setLED(led, LED_OFF)
+        # sleep for the duration
+        time.sleep(duration)
+
+def ledSET(led, command):
+    '''
+    Sets the LED to the passed command
+    :param led: the string of the LED
+    :param command: a string representing the Command either (On, Off, Blink)
+    :return: True if successful, otherwise false
+    '''
+    #valid commands
+    valid_commands = {"on" : ledON, "off" : ledOFF, 'flash' : ledFLASH}
+    #make sure the led is in the disctionary
+    if led in LEDS:
+        #make sure the command is valid
+        if command in valid_commands :
+            #execute the command
+             return valid_commands[command](led)
+    return False
+
+
diff --git a/files/demo_brk/LEDWebDemo/ledTemplate.html b/files/demo_brk/LEDWebDemo/ledTemplate.html
new file mode 100644
index 0000000..f258ab5
--- /dev/null
+++ b/files/demo_brk/LEDWebDemo/ledTemplate.html
@@ -0,0 +1,37 @@
+
+
+
+    
+    OSD32MP1-BRK LED Blink Demo
+
+
+    

OSD32MP1-BRK LED Web Example

+

Click on the buttons next to the cooresponding LED to control it.
+ Note: Flashing could take a few seconds to start and stop.

+
+ + + + + + + + + + + + + + + + + + + + + + +
D1 Green
{d1g_status}:
D1 Red{d1r_status}:
D2 Green{d2g_status}:
+
+ + diff --git a/files/OSD32MP1_RED_intro_360p.mp4 b/files/demo_red/OSD32MP1_RED_intro_360p.mp4 similarity index 100% rename from files/OSD32MP1_RED_intro_360p.mp4 rename to files/demo_red/OSD32MP1_RED_intro_360p.mp4 diff --git a/files/demo_camera.sh b/files/demo_red/demo_camera.sh similarity index 100% rename from files/demo_camera.sh rename to files/demo_red/demo_camera.sh diff --git a/files/demo_video.sh b/files/demo_red/demo_video.sh similarity index 100% rename from files/demo_video.sh rename to files/demo_red/demo_video.sh diff --git a/files/fsbl/Makefile.sdk b/files/fsbl/Makefile.sdk index e3a2cee..aa9dbbd 100644 --- a/files/fsbl/Makefile.sdk +++ b/files/fsbl/Makefile.sdk @@ -28,7 +28,7 @@ TF_A_BINARY_optee ?= tf-a TF_A_MAKE_TARGET_optee ?= dtbs # Init default config settings -TF_A_DEVICETREE_trusted ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red +TF_A_DEVICETREE_trusted ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red stm32mp157c-osd32mp1-brk TF_A_EXTRA_OPTFLAGS_trusted ?= AARCH32_SP=sp_min TF_A_BINARY_trusted ?= tf-a TF_A_MAKE_TARGET_trusted ?= bl32 dtbs @@ -52,19 +52,19 @@ TF_A_BINARY_nor ?= tf-a TF_A_MAKE_TARGET_nor ?= all # Init default config settings -TF_A_DEVICETREE_sdcard ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red +TF_A_DEVICETREE_sdcard ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red stm32mp157c-osd32mp1-brk TF_A_EXTRA_OPTFLAGS_sdcard ?= STM32MP_SDMMC=1 TF_A_BINARY_sdcard ?= tf-a TF_A_MAKE_TARGET_sdcard ?= all # Init default config settings -TF_A_DEVICETREE_uart ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red +TF_A_DEVICETREE_uart ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red stm32mp157c-osd32mp1-brk TF_A_EXTRA_OPTFLAGS_uart ?= STM32MP_UART_PROGRAMMER=1 TF_A_BINARY_uart ?= tf-a TF_A_MAKE_TARGET_uart ?= all # Init default config settings -TF_A_DEVICETREE_usb ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red +TF_A_DEVICETREE_usb ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red stm32mp157c-osd32mp1-brk TF_A_EXTRA_OPTFLAGS_usb ?= STM32MP_USB_PROGRAMMER=1 TF_A_BINARY_usb ?= tf-a TF_A_MAKE_TARGET_usb ?= all @@ -83,7 +83,7 @@ NM = EXTRA_OEMAKE ?= CROSS_COMPILE=arm-linux-gnueabihf- DEBUG=1 LOG_LEVEL=40 PLAT=stm32mp1 ARCH=aarch32 ARM_ARCH_MAJOR=7 # Configure overall devicetree list for FIP -TF_A_DEVICETREE_ALL = stm32mp157a-dk1 stm32mp157a-ev1 stm32mp157c-dk2 stm32mp157c-ed1 stm32mp157c-ev1 stm32mp157d-dk1 stm32mp157d-ev1 stm32mp157f-dk2 stm32mp157f-ed1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red +TF_A_DEVICETREE_ALL = stm32mp157a-dk1 stm32mp157a-ev1 stm32mp157c-dk2 stm32mp157c-ed1 stm32mp157c-ev1 stm32mp157d-dk1 stm32mp157d-ev1 stm32mp157f-dk2 stm32mp157f-ed1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red stm32mp157c-osd32mp1-brk # Display TF-A config details define tf-configs diff --git a/files/rootfs/fstab_emmc b/files/rootfs/fstab_emmc_stm32mp157c-osd32mp1-red similarity index 100% rename from files/rootfs/fstab_emmc rename to files/rootfs/fstab_emmc_stm32mp157c-osd32mp1-red diff --git a/files/rootfs/fstab_sdcard_stm32mp157c-osd32mp1-brk b/files/rootfs/fstab_sdcard_stm32mp157c-osd32mp1-brk new file mode 100644 index 0000000..daef49c --- /dev/null +++ b/files/rootfs/fstab_sdcard_stm32mp157c-osd32mp1-brk @@ -0,0 +1,7 @@ +/dev/root / auto defaults 1 1 +proc /proc proc defaults 0 0 +devpts /dev/pts devpts mode=0620,gid=5 0 0 +tmpfs /run tmpfs mode=0755,nodev,nosuid,strictatime 0 0 +tmpfs /var/volatile tmpfs defaults 0 0 +/dev/mmcblk0p4 /boot ext4 defaults,sync 0 1 +/dev/mmcblk0p5 /vendor ext4 defaults,sync 0 1 diff --git a/files/rootfs/fstab_sdcard b/files/rootfs/fstab_sdcard_stm32mp157c-osd32mp1-red similarity index 100% rename from files/rootfs/fstab_sdcard rename to files/rootfs/fstab_sdcard_stm32mp157c-osd32mp1-red diff --git a/files/ssbl/Makefile.sdk b/files/ssbl/Makefile.sdk index 31f48b4..b5bdf4f 100644 --- a/files/ssbl/Makefile.sdk +++ b/files/ssbl/Makefile.sdk @@ -12,7 +12,7 @@ UBOOT_LOCALVERSION = # Configure default U-Boot configs UBOOT_CONFIGS ?= stm32mp15_trusted_defconfig,trusted,u-boot.dtb stm32mp15_basic_defconfig,basic,u-boot.img -DEVICE_TREE ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red +DEVICE_TREE ?= stm32mp157a-dk1 stm32mp157d-dk1 stm32mp157c-dk2 stm32mp157f-dk2 stm32mp157c-ed1 stm32mp157f-ed1 stm32mp157a-ev1 stm32mp157c-ev1 stm32mp157d-ev1 stm32mp157f-ev1 stm32mp157c-osd32mp1-red stm32mp157c-osd32mp1-brk # Configure default fip feature ENABLE_FIP ?= "1" diff --git a/patches/linux-5.10/0024-Add-OSD32MP1-RED-Device-tree-support.patch b/patches/linux-5.10/0024-Add-OSD32MP1-RED-Device-tree-support.patch index 3465d24..9ed3db0 100644 --- a/patches/linux-5.10/0024-Add-OSD32MP1-RED-Device-tree-support.patch +++ b/patches/linux-5.10/0024-Add-OSD32MP1-RED-Device-tree-support.patch @@ -1,12 +1,12 @@ -From 4cb8ba678697873b65f01413329e9bf7878614b7 Mon Sep 17 00:00:00 2001 -From: "neeraj.dantu" -Date: Sun, 21 Nov 2021 23:54:21 -0600 -Subject: [PATCH 2/2] Add OSD32MP1-RED Device tree support +From 2ff756826654a92602b68ea528d6a405c0d463f7 Mon Sep 17 00:00:00 2001 +From: Neeraj Dantu +Date: Tue, 1 Mar 2022 14:54:53 -0600 +Subject: [PATCH] Add-OSD32MP1-RED-Device-tree-support --- arch/arm/boot/dts/Makefile | 3 +- - .../arm/boot/dts/stm32mp157c-osd32mp1-red.dts | 1444 +++++++++++++++++ - 2 files changed, 1446 insertions(+), 1 deletion(-) + .../arm/boot/dts/stm32mp157c-osd32mp1-red.dts | 1440 +++++++++++++++++ + 2 files changed, 1442 insertions(+), 1 deletion(-) create mode 100644 arch/arm/boot/dts/stm32mp157c-osd32mp1-red.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile @@ -25,10 +25,10 @@ index 0cf0be3d892e..901ef5f3047f 100644 sun4i-a10-ba10-tvbox.dtb \ diff --git a/arch/arm/boot/dts/stm32mp157c-osd32mp1-red.dts b/arch/arm/boot/dts/stm32mp157c-osd32mp1-red.dts new file mode 100644 -index 000000000000..19c2a6072e1a +index 000000000000..bf0e23c76150 --- /dev/null +++ b/arch/arm/boot/dts/stm32mp157c-osd32mp1-red.dts -@@ -0,0 +1,1444 @@ +@@ -0,0 +1,1440 @@ +/* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */ +/* + * Copyright (C) Octavo Systems 2021 - All Rights Reserved @@ -160,10 +160,6 @@ index 000000000000..19c2a6072e1a + sound { + compatible = "audio-graph-card"; + label = "STM32MP15-DK"; -+ routing = -+ "Playback" , "MCLK", -+ "Capture" , "MCLK", -+ "MICL" , "Mic Bias"; + dais = <&i2s2_port>; + status = "okay"; + }; @@ -917,11 +913,8 @@ index 000000000000..19c2a6072e1a + reset-gpios = <&gpiog 0 GPIO_ACTIVE_LOW>; + interrupts = <1 IRQ_TYPE_EDGE_FALLING>; + interrupt-parent = <&gpiog>; -+ pinctrl-names = "default", "sleep"; -+ pinctrl-0 = <<dc_pins_mx>; -+ pinctrl-1 = <<dc_sleep_pins_mx>; ++ #sound-dai-cells = <0>; + status = "okay"; -+ + ports { + #address-cells = <1>; + #size-cells = <0>; @@ -933,8 +926,8 @@ index 000000000000..19c2a6072e1a + }; + }; + -+ port@1 { -+ reg = <1>; ++ port@3 { ++ reg = <3>; + sii9022_tx_endpoint: endpoint { + remote-endpoint = <&i2s2_endpoint>; + }; @@ -1201,7 +1194,7 @@ index 000000000000..19c2a6072e1a +}; + +&i2s2{ -+ clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc CK_PER>, <&rcc PLL3_R>; ++ clocks = <&rcc SPI2>, <&rcc SPI2_K>, <&rcc PLL3_Q>, <&rcc PLL3_R>; + clock-names = "pclk", "i2sclk", "x8k", "x11k"; + pinctrl-names = "default", "sleep"; + pinctrl-0 = <&i2s2_pins_mx>; @@ -1227,6 +1220,9 @@ index 000000000000..19c2a6072e1a +}; + +<dc{ ++ pinctrl-names = "default", "sleep"; ++ pinctrl-0 = <<dc_pins_mx>; ++ pinctrl-1 = <<dc_sleep_pins_mx>; + status = "okay"; + port { + ltdc_ep0_out: endpoint@0 { @@ -1474,5 +1470,5 @@ index 000000000000..19c2a6072e1a + status = "okay"; +}; -- -2.17.1 +2.25.1 diff --git a/stm32mp157c-osd32mp1-brk-extlinux.sh b/stm32mp157c-osd32mp1-brk-extlinux.sh new file mode 100755 index 0000000..f02adb2 --- /dev/null +++ b/stm32mp157c-osd32mp1-brk-extlinux.sh @@ -0,0 +1,56 @@ +#!/bin/bash -e + +DEPLOY_DIR=./ + +while getopts d: option +do +case "${option}" +in +d) DEPLOY_DIR=${OPTARG};; +esac +done + +BOARD_NAME=stm32mp157c-osd32mp1-brk + +export BOOT_DEVICES_LIST=" \ + mmc0 \ +" + +UBOOT_SPLASH_IMAGE_mmc0="/splash.bmp" +UBOOT_EXTLINUX_TIMEOUT_mmc0=20 +UBOOT_EXTLINUX_DEFAULT_LABEL_mmc0=osd32mp1-brk-sdcard +UBOOT_EXTLINUX_LABEL_mmc0=osd32mp1-brk-sdcard +UBOOT_EXTLINUX_KERNEL_IMAGE_mmc0="/uImage" +UBOOT_EXTLINUX_FDTDIR_mmc0="/stm32mp157c-osd32mp1-brk.dtb" +UBOOT_EXTLINUX_ARGS_mmc0="root=/dev/mmcblk0p6 rootwait rw console=ttySTM0,115200 init=/sbin/init firmware_class.path=/lib/firmware/" + +UBOOT_SPLASH_IMAGE_mmc1="/splash.bmp" +UBOOT_EXTLINUX_TIMEOUT_mmc1=20 +UBOOT_EXTLINUX_DEFAULT_LABEL_mmc1=osd32mp1-red-emmc +UBOOT_EXTLINUX_LABEL_mmc1=osd32mp1-red-emmc +UBOOT_EXTLINUX_KERNEL_IMAGE_mmc1="/uImage" +UBOOT_EXTLINUX_FDTDIR_mmc1="/stm32mp157c-osd32mp1-brk.dtb" +UBOOT_EXTLINUX_ARGS_mmc1="root=/dev/mmcblk2p4 rootwait rw console=ttySTM0,115200 init=/sbin/init firmware_class.path=/lib/firmware/" + + +for boot_device in ${BOOT_DEVICES_LIST} ; do + mkdir -p ${DEPLOY_DIR}/${boot_device}_extlinux + UBOOT_SPLASH_IMAGE=UBOOT_SPLASH_IMAGE_$boot_device + UBOOT_EXTLINUX_TIMEOUT=UBOOT_EXTLINUX_TIMEOUT_$boot_device + UBOOT_EXTLINUX_DEFAULT_LABEL=UBOOT_EXTLINUX_DEFAULT_LABEL_$boot_device + UBOOT_EXTLINUX_LABEL=UBOOT_EXTLINUX_LABEL_$boot_device + UBOOT_EXTLINUX_KERNEL_IMAGE=UBOOT_EXTLINUX_KERNEL_IMAGE_$boot_device + UBOOT_EXTLINUX_FDTDIR=UBOOT_EXTLINUX_FDTDIR_$boot_device + UBOOT_EXTLINUX_ARGS=UBOOT_EXTLINUX_ARGS_$boot_device +cat <${DEPLOY_DIR}/${boot_device}_extlinux/extlinux.conf +# Generic Distro Configuration file generated by Octavo Build System +menu title Select the boot mode +MENU BACKGROUND ${!UBOOT_SPLASH_IMAGE} +TIMEOUT ${!UBOOT_EXTLINUX_TIMEOUT} +DEFAULT ${!UBOOT_EXTLINUX_DEFAULT_LABEL} +LABEL ${!UBOOT_EXTLINUX_LABEL} + KERNEL ${!UBOOT_EXTLINUX_KERNEL_IMAGE} + FDT ${!UBOOT_EXTLINUX_FDTDIR} + APPEND ${!UBOOT_EXTLINUX_ARGS} +EOF +done