summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2022-01-06 10:42:25 +0700
committerGitHub <[email protected]>2022-01-06 10:42:25 +0700
commit77b42344ac5a6f230e7f2958d6d832d52bf94446 (patch)
tree164feb2573e005e3514f90d0c0bd38965d32ae92
parent868948f67c90fa7c2553cdcd604b52862cf55720 (diff)
parentbed8913107efeb4b38d80f5cc4caef2fd351b57f (diff)
Merge pull request #1271 from tannewt/rpi_zero
Add Raspberry Pi Zero W and Zero 2 W
-rw-r--r--.github/workflows/build_aarch64.yml2
-rw-r--r--.github/workflows/build_arm.yml3
-rw-r--r--.gitignore2
-rw-r--r--examples/device/audio_4_channel_mic/.skip.MCU_SAMD110
-rw-r--r--examples/device/audio_4_channel_mic/.skip.MCU_SAME5X0
-rw-r--r--examples/device/audio_4_channel_mic/.skip.MCU_SAMG0
-rw-r--r--examples/device/audio_4_channel_mic/skip.txt3
-rw-r--r--examples/device/audio_test/.skip.MCU_SAMD110
-rw-r--r--examples/device/audio_test/.skip.MCU_SAME5X0
-rw-r--r--examples/device/audio_test/.skip.MCU_SAMG0
-rw-r--r--examples/device/audio_test/skip.txt3
-rw-r--r--examples/device/cdc_msc/.skip.MCU_SAMD110
-rw-r--r--examples/device/cdc_msc/skip.txt1
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_BCM27110
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_CXD560
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_GD32VF1030
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX0
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx0
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_RP20400
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_SAMD110
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X0
-rw-r--r--examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI0
-rw-r--r--examples/device/cdc_msc_freertos/skip.txt10
-rw-r--r--examples/device/dfu/.skip.MCU_TM4C1234
-rw-r--r--examples/device/dfu/skip.txt2
-rw-r--r--examples/device/dynamic_configuration/.skip.MCU_SAMD110
-rw-r--r--examples/device/dynamic_configuration/skip.txt1
-rw-r--r--examples/device/hid_composite_freertos/.skip.MCU_BCM27110
-rw-r--r--examples/device/hid_composite_freertos/.skip.MCU_CXD560
-rw-r--r--examples/device/hid_composite_freertos/.skip.MCU_GD32VF1030
-rw-r--r--examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx0
-rw-r--r--examples/device/hid_composite_freertos/.skip.MCU_RP20400
-rw-r--r--examples/device/hid_composite_freertos/.skip.MCU_SAMD110
-rw-r--r--examples/device/hid_composite_freertos/.skip.MCU_SAMX7X0
-rw-r--r--examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI0
-rw-r--r--examples/device/hid_composite_freertos/skip.txt9
-rw-r--r--examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX0
-rw-r--r--examples/device/msc_dual_lun/.skip.MCU_SAMD110
-rw-r--r--examples/device/msc_dual_lun/skip.txt2
-rw-r--r--examples/device/net_lwip_webserver/.skip.MCU_BCM27111
-rw-r--r--examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX0
-rw-r--r--examples/device/net_lwip_webserver/.skip.MCU_LPC13XX0
-rw-r--r--examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX0
-rw-r--r--examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx1
-rw-r--r--examples/device/net_lwip_webserver/.skip.MCU_NUC1210
-rw-r--r--examples/device/net_lwip_webserver/.skip.MCU_SAMD110
-rw-r--r--examples/device/net_lwip_webserver/.skip.MCU_STM32L00
-rw-r--r--examples/device/net_lwip_webserver/skip.txt10
-rw-r--r--examples/device/uac2_headset/.skip.MCU_LPC11UXX0
-rw-r--r--examples/device/uac2_headset/.skip.MCU_LPC13XX0
-rw-r--r--examples/device/uac2_headset/.skip.MCU_NUC1210
-rw-r--r--examples/device/uac2_headset/.skip.MCU_SAMD110
-rw-r--r--examples/device/uac2_headset/.skip.MCU_SAME5X0
-rw-r--r--examples/device/uac2_headset/.skip.MCU_SAMG0
-rw-r--r--examples/device/uac2_headset/skip.txt6
-rw-r--r--examples/device/usbtmc/skip.txt1
-rw-r--r--examples/device/video_capture/.skip.MCU_MSP430x5xx1
-rw-r--r--examples/device/video_capture/.skip.MCU_SAMD110
-rw-r--r--examples/device/video_capture/skip.txt2
-rw-r--r--examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X0
-rw-r--r--examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X0
-rw-r--r--examples/host/cdc_msc_hid/.only.MCU_LPC18XX0
-rw-r--r--examples/host/cdc_msc_hid/.only.MCU_LPC40XX0
-rw-r--r--examples/host/cdc_msc_hid/.only.MCU_LPC43XX0
-rw-r--r--examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX0
-rw-r--r--examples/host/cdc_msc_hid/.only.MCU_MSP432E40
-rw-r--r--examples/host/cdc_msc_hid/.only.MCU_RP20400
-rw-r--r--examples/host/cdc_msc_hid/only.txt8
-rw-r--r--examples/host/hid_controller/.only.MCU_LPC175X_6X0
-rw-r--r--examples/host/hid_controller/.only.MCU_LPC177X_8X0
-rw-r--r--examples/host/hid_controller/.only.MCU_LPC18XX0
-rw-r--r--examples/host/hid_controller/.only.MCU_LPC40XX0
-rw-r--r--examples/host/hid_controller/.only.MCU_LPC43XX0
-rw-r--r--examples/host/hid_controller/.only.MCU_MIMXRT10XX0
-rw-r--r--examples/host/hid_controller/.only.MCU_MSP432E40
-rw-r--r--examples/host/hid_controller/.only.MCU_RP20400
-rw-r--r--examples/host/hid_controller/only.txt8
-rw-r--r--hw/bsp/board_mcu.h5
-rw-r--r--hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.h (renamed from hw/bsp/raspberrypi4/boards/raspberrypi_cm4/board.h)0
-rw-r--r--hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.mk5
-rw-r--r--hw/bsp/broadcom_32bit/family.c (renamed from hw/bsp/raspberrypi4/family.c)32
-rw-r--r--hw/bsp/broadcom_32bit/family.mk46
-rw-r--r--hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.h38
-rw-r--r--hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.mk3
-rw-r--r--hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.h38
-rw-r--r--hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.mk3
-rw-r--r--hw/bsp/broadcom_64bit/family.c156
-rw-r--r--hw/bsp/broadcom_64bit/family.mk (renamed from hw/bsp/raspberrypi4/family.mk)19
-rw-r--r--hw/bsp/raspberrypi4/boards/raspberrypi_cm4/board.mk1
-rw-r--r--hw/bsp/samd21/boards/curiosity_nano/.skip.device.net_lwip_webserver0
m---------hw/mcu/broadcom0
-rw-r--r--src/class/usbtmc/usbtmc_device.c18
-rw-r--r--src/device/dcd_attr.h2
-rw-r--r--src/portable/synopsys/dwc2/dcd_dwc2.c5
-rw-r--r--src/portable/synopsys/dwc2/dwc2_bcm.h3
-rw-r--r--src/tusb_option.h2
-rw-r--r--tools/build_board.py31
-rw-r--r--tools/build_esp32sx.py7
-rw-r--r--tools/build_family.py46
-rw-r--r--tools/build_utils.py61
100 files changed, 481 insertions, 120 deletions
diff --git a/.github/workflows/build_aarch64.yml b/.github/workflows/build_aarch64.yml
index 0cc7a5de1..8cf7852b9 100644
--- a/.github/workflows/build_aarch64.yml
+++ b/.github/workflows/build_aarch64.yml
@@ -18,7 +18,7 @@ jobs:
matrix:
family:
# Alphabetical order
- - 'raspberrypi4'
+ - 'broadcom_64bit'
steps:
- name: Setup Python
uses: actions/setup-python@v2
diff --git a/.github/workflows/build_arm.yml b/.github/workflows/build_arm.yml
index dc4d9fcfb..177f1076e 100644
--- a/.github/workflows/build_arm.yml
+++ b/.github/workflows/build_arm.yml
@@ -39,6 +39,7 @@ jobs:
matrix:
family:
# Alphabetical order
+ - 'broadcom_32bit'
- 'imxrt'
- 'lpc15'
- 'lpc18'
@@ -114,7 +115,7 @@ jobs:
done
# ---------------------------------------
- # Build all no-family (opharned) boards
+ # Build all no-family (orphaned) boards
# ---------------------------------------
build-board:
runs-on: ubuntu-latest
diff --git a/.gitignore b/.gitignore
index f7adff4c9..87a5faa80 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,3 +26,5 @@ cov-int
# cppcheck build directories
*-build-dir
/_bin/
+__pycache__
+
diff --git a/examples/device/audio_4_channel_mic/.skip.MCU_SAMD11 b/examples/device/audio_4_channel_mic/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/audio_4_channel_mic/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/audio_4_channel_mic/.skip.MCU_SAME5X b/examples/device/audio_4_channel_mic/.skip.MCU_SAME5X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/audio_4_channel_mic/.skip.MCU_SAME5X
+++ /dev/null
diff --git a/examples/device/audio_4_channel_mic/.skip.MCU_SAMG b/examples/device/audio_4_channel_mic/.skip.MCU_SAMG
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/audio_4_channel_mic/.skip.MCU_SAMG
+++ /dev/null
diff --git a/examples/device/audio_4_channel_mic/skip.txt b/examples/device/audio_4_channel_mic/skip.txt
new file mode 100644
index 000000000..ae9b57f1f
--- /dev/null
+++ b/examples/device/audio_4_channel_mic/skip.txt
@@ -0,0 +1,3 @@
+mcu:SAMD11
+mcu:SAME5X
+mcu:SAMG \ No newline at end of file
diff --git a/examples/device/audio_test/.skip.MCU_SAMD11 b/examples/device/audio_test/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/audio_test/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/audio_test/.skip.MCU_SAME5X b/examples/device/audio_test/.skip.MCU_SAME5X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/audio_test/.skip.MCU_SAME5X
+++ /dev/null
diff --git a/examples/device/audio_test/.skip.MCU_SAMG b/examples/device/audio_test/.skip.MCU_SAMG
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/audio_test/.skip.MCU_SAMG
+++ /dev/null
diff --git a/examples/device/audio_test/skip.txt b/examples/device/audio_test/skip.txt
new file mode 100644
index 000000000..ae9b57f1f
--- /dev/null
+++ b/examples/device/audio_test/skip.txt
@@ -0,0 +1,3 @@
+mcu:SAMD11
+mcu:SAME5X
+mcu:SAMG \ No newline at end of file
diff --git a/examples/device/cdc_msc/.skip.MCU_SAMD11 b/examples/device/cdc_msc/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/cdc_msc/skip.txt b/examples/device/cdc_msc/skip.txt
new file mode 100644
index 000000000..d844feae8
--- /dev/null
+++ b/examples/device/cdc_msc/skip.txt
@@ -0,0 +1 @@
+mcu:SAMD11 \ No newline at end of file
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_BCM2711 b/examples/device/cdc_msc_freertos/.skip.MCU_BCM2711
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_BCM2711
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_CXD56 b/examples/device/cdc_msc_freertos/.skip.MCU_CXD56
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_CXD56
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_GD32VF103 b/examples/device/cdc_msc_freertos/.skip.MCU_GD32VF103
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_GD32VF103
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX b/examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_MKL25ZXX
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx b/examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_MSP430x5xx
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_RP2040 b/examples/device/cdc_msc_freertos/.skip.MCU_RP2040
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_RP2040
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_SAMD11 b/examples/device/cdc_msc_freertos/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X b/examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_SAMX7X
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI b/examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/cdc_msc_freertos/.skip.MCU_VALENTYUSB_EPTRI
+++ /dev/null
diff --git a/examples/device/cdc_msc_freertos/skip.txt b/examples/device/cdc_msc_freertos/skip.txt
new file mode 100644
index 000000000..7137b78af
--- /dev/null
+++ b/examples/device/cdc_msc_freertos/skip.txt
@@ -0,0 +1,10 @@
+mcu:CXD56
+mcu:MSP430x5xx
+mcu:SAMD11
+mcu:VALENTYUSB_EPTRI
+mcu:MKL25ZXX
+mcu:RP2040
+mcu:SAMX7X
+mcu:GD32VF103
+family:broadcom_64bit
+family:broadcom_32bit \ No newline at end of file
diff --git a/examples/device/dfu/.skip.MCU_TM4C123 b/examples/device/dfu/.skip.MCU_TM4C123
deleted file mode 100644
index 6260e6e25..000000000
--- a/examples/device/dfu/.skip.MCU_TM4C123
+++ /dev/null
@@ -1,4 +0,0 @@
-LINK _build/ek-tm4c123gxl/dfu.elf
-/home/runner/cache/toolchain/xpack-arm-none-eabi-gcc-10.2.1-1.1/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: section .ARM.exidx.text._close LMA [0000000000002980,0000000000002987] overlaps section .data LMA [0000000000002980,0000000000002a03]
-collect2: error: ld returned 1 exit status
-make: *** [../../rules.mk:94: _build/ek-tm4c123gxl/dfu.elf] Error 1 \ No newline at end of file
diff --git a/examples/device/dfu/skip.txt b/examples/device/dfu/skip.txt
new file mode 100644
index 000000000..9ac346bad
--- /dev/null
+++ b/examples/device/dfu/skip.txt
@@ -0,0 +1,2 @@
+mcu:TM4C123
+mcu:BCM2835
diff --git a/examples/device/dynamic_configuration/.skip.MCU_SAMD11 b/examples/device/dynamic_configuration/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/dynamic_configuration/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/dynamic_configuration/skip.txt b/examples/device/dynamic_configuration/skip.txt
new file mode 100644
index 000000000..d844feae8
--- /dev/null
+++ b/examples/device/dynamic_configuration/skip.txt
@@ -0,0 +1 @@
+mcu:SAMD11 \ No newline at end of file
diff --git a/examples/device/hid_composite_freertos/.skip.MCU_BCM2711 b/examples/device/hid_composite_freertos/.skip.MCU_BCM2711
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/hid_composite_freertos/.skip.MCU_BCM2711
+++ /dev/null
diff --git a/examples/device/hid_composite_freertos/.skip.MCU_CXD56 b/examples/device/hid_composite_freertos/.skip.MCU_CXD56
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/hid_composite_freertos/.skip.MCU_CXD56
+++ /dev/null
diff --git a/examples/device/hid_composite_freertos/.skip.MCU_GD32VF103 b/examples/device/hid_composite_freertos/.skip.MCU_GD32VF103
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/hid_composite_freertos/.skip.MCU_GD32VF103
+++ /dev/null
diff --git a/examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx b/examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/hid_composite_freertos/.skip.MCU_MSP430x5xx
+++ /dev/null
diff --git a/examples/device/hid_composite_freertos/.skip.MCU_RP2040 b/examples/device/hid_composite_freertos/.skip.MCU_RP2040
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/hid_composite_freertos/.skip.MCU_RP2040
+++ /dev/null
diff --git a/examples/device/hid_composite_freertos/.skip.MCU_SAMD11 b/examples/device/hid_composite_freertos/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/hid_composite_freertos/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/hid_composite_freertos/.skip.MCU_SAMX7X b/examples/device/hid_composite_freertos/.skip.MCU_SAMX7X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/hid_composite_freertos/.skip.MCU_SAMX7X
+++ /dev/null
diff --git a/examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI b/examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/hid_composite_freertos/.skip.MCU_VALENTYUSB_EPTRI
+++ /dev/null
diff --git a/examples/device/hid_composite_freertos/skip.txt b/examples/device/hid_composite_freertos/skip.txt
new file mode 100644
index 000000000..e64187fd4
--- /dev/null
+++ b/examples/device/hid_composite_freertos/skip.txt
@@ -0,0 +1,9 @@
+mcu:CXD56
+mcu:MSP430x5xx
+mcu:SAMD11
+mcu:VALENTYUSB_EPTRI
+mcu:RP2040
+mcu:SAMX7X
+mcu:GD32VF103
+family:broadcom_64bit
+family:broadcom_32bit \ No newline at end of file
diff --git a/examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX b/examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/msc_dual_lun/.skip.MCU_MKL25ZXX
+++ /dev/null
diff --git a/examples/device/msc_dual_lun/.skip.MCU_SAMD11 b/examples/device/msc_dual_lun/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/msc_dual_lun/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/msc_dual_lun/skip.txt b/examples/device/msc_dual_lun/skip.txt
new file mode 100644
index 000000000..3549c702a
--- /dev/null
+++ b/examples/device/msc_dual_lun/skip.txt
@@ -0,0 +1,2 @@
+mcu:SAMD11
+mcu:MKL25ZXX \ No newline at end of file
diff --git a/examples/device/net_lwip_webserver/.skip.MCU_BCM2711 b/examples/device/net_lwip_webserver/.skip.MCU_BCM2711
deleted file mode 100644
index bdc68f5db..000000000
--- a/examples/device/net_lwip_webserver/.skip.MCU_BCM2711
+++ /dev/null
@@ -1 +0,0 @@
-tinyusb/lib/lwip/src/include/lwip/arch.h:202:13: error: conflicting types for 'ssize_t' \ No newline at end of file
diff --git a/examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX b/examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/net_lwip_webserver/.skip.MCU_LPC11UXX
+++ /dev/null
diff --git a/examples/device/net_lwip_webserver/.skip.MCU_LPC13XX b/examples/device/net_lwip_webserver/.skip.MCU_LPC13XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/net_lwip_webserver/.skip.MCU_LPC13XX
+++ /dev/null
diff --git a/examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX b/examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/net_lwip_webserver/.skip.MCU_MKL25ZXX
+++ /dev/null
diff --git a/examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx b/examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx
deleted file mode 100644
index 17600f062..000000000
--- a/examples/device/net_lwip_webserver/.skip.MCU_MSP430x5xx
+++ /dev/null
@@ -1 +0,0 @@
-too many warnings for 16-bit integer overflow
diff --git a/examples/device/net_lwip_webserver/.skip.MCU_NUC121 b/examples/device/net_lwip_webserver/.skip.MCU_NUC121
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/net_lwip_webserver/.skip.MCU_NUC121
+++ /dev/null
diff --git a/examples/device/net_lwip_webserver/.skip.MCU_SAMD11 b/examples/device/net_lwip_webserver/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/net_lwip_webserver/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/net_lwip_webserver/.skip.MCU_STM32L0 b/examples/device/net_lwip_webserver/.skip.MCU_STM32L0
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/net_lwip_webserver/.skip.MCU_STM32L0
+++ /dev/null
diff --git a/examples/device/net_lwip_webserver/skip.txt b/examples/device/net_lwip_webserver/skip.txt
new file mode 100644
index 000000000..68761b058
--- /dev/null
+++ b/examples/device/net_lwip_webserver/skip.txt
@@ -0,0 +1,10 @@
+mcu:LPC11UXX
+mcu:LPC13XX
+mcu:MSP430x5xx
+mcu:NUC121
+mcu:SAMD11
+mcu:STM32L0
+mcu:MKL25ZXX
+family:broadcom_64bit
+family:broadcom_32bit
+board:curiosity_nano \ No newline at end of file
diff --git a/examples/device/uac2_headset/.skip.MCU_LPC11UXX b/examples/device/uac2_headset/.skip.MCU_LPC11UXX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/uac2_headset/.skip.MCU_LPC11UXX
+++ /dev/null
diff --git a/examples/device/uac2_headset/.skip.MCU_LPC13XX b/examples/device/uac2_headset/.skip.MCU_LPC13XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/uac2_headset/.skip.MCU_LPC13XX
+++ /dev/null
diff --git a/examples/device/uac2_headset/.skip.MCU_NUC121 b/examples/device/uac2_headset/.skip.MCU_NUC121
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/uac2_headset/.skip.MCU_NUC121
+++ /dev/null
diff --git a/examples/device/uac2_headset/.skip.MCU_SAMD11 b/examples/device/uac2_headset/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/uac2_headset/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/uac2_headset/.skip.MCU_SAME5X b/examples/device/uac2_headset/.skip.MCU_SAME5X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/uac2_headset/.skip.MCU_SAME5X
+++ /dev/null
diff --git a/examples/device/uac2_headset/.skip.MCU_SAMG b/examples/device/uac2_headset/.skip.MCU_SAMG
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/uac2_headset/.skip.MCU_SAMG
+++ /dev/null
diff --git a/examples/device/uac2_headset/skip.txt b/examples/device/uac2_headset/skip.txt
new file mode 100644
index 000000000..9471822a4
--- /dev/null
+++ b/examples/device/uac2_headset/skip.txt
@@ -0,0 +1,6 @@
+mcu:LPC11UXX
+mcu:LPC13XX
+mcu:NUC121
+mcu:SAMD11
+mcu:SAME5X
+mcu:SAMG \ No newline at end of file
diff --git a/examples/device/usbtmc/skip.txt b/examples/device/usbtmc/skip.txt
new file mode 100644
index 000000000..a43106cf0
--- /dev/null
+++ b/examples/device/usbtmc/skip.txt
@@ -0,0 +1 @@
+mcu:BCM2835
diff --git a/examples/device/video_capture/.skip.MCU_MSP430x5xx b/examples/device/video_capture/.skip.MCU_MSP430x5xx
deleted file mode 100644
index 17600f062..000000000
--- a/examples/device/video_capture/.skip.MCU_MSP430x5xx
+++ /dev/null
@@ -1 +0,0 @@
-too many warnings for 16-bit integer overflow
diff --git a/examples/device/video_capture/.skip.MCU_SAMD11 b/examples/device/video_capture/.skip.MCU_SAMD11
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/device/video_capture/.skip.MCU_SAMD11
+++ /dev/null
diff --git a/examples/device/video_capture/skip.txt b/examples/device/video_capture/skip.txt
new file mode 100644
index 000000000..892a8c6a7
--- /dev/null
+++ b/examples/device/video_capture/skip.txt
@@ -0,0 +1,2 @@
+mcu:MSP430x5xx
+mcu:SAMD11 \ No newline at end of file
diff --git a/examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X b/examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/cdc_msc_hid/.only.MCU_LPC175X_6X
+++ /dev/null
diff --git a/examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X b/examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/cdc_msc_hid/.only.MCU_LPC177X_8X
+++ /dev/null
diff --git a/examples/host/cdc_msc_hid/.only.MCU_LPC18XX b/examples/host/cdc_msc_hid/.only.MCU_LPC18XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/cdc_msc_hid/.only.MCU_LPC18XX
+++ /dev/null
diff --git a/examples/host/cdc_msc_hid/.only.MCU_LPC40XX b/examples/host/cdc_msc_hid/.only.MCU_LPC40XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/cdc_msc_hid/.only.MCU_LPC40XX
+++ /dev/null
diff --git a/examples/host/cdc_msc_hid/.only.MCU_LPC43XX b/examples/host/cdc_msc_hid/.only.MCU_LPC43XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/cdc_msc_hid/.only.MCU_LPC43XX
+++ /dev/null
diff --git a/examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX b/examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/cdc_msc_hid/.only.MCU_MIMXRT10XX
+++ /dev/null
diff --git a/examples/host/cdc_msc_hid/.only.MCU_MSP432E4 b/examples/host/cdc_msc_hid/.only.MCU_MSP432E4
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/cdc_msc_hid/.only.MCU_MSP432E4
+++ /dev/null
diff --git a/examples/host/cdc_msc_hid/.only.MCU_RP2040 b/examples/host/cdc_msc_hid/.only.MCU_RP2040
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/cdc_msc_hid/.only.MCU_RP2040
+++ /dev/null
diff --git a/examples/host/cdc_msc_hid/only.txt b/examples/host/cdc_msc_hid/only.txt
new file mode 100644
index 000000000..db9a337e5
--- /dev/null
+++ b/examples/host/cdc_msc_hid/only.txt
@@ -0,0 +1,8 @@
+mcu:LPC175X_6X
+mcu:LPC177X_8X
+mcu:LPC18XX
+mcu:LPC40XX
+mcu:LPC43XX
+mcu:MIMXRT10XX
+mcu:RP2040
+mcu:MSP432E4 \ No newline at end of file
diff --git a/examples/host/hid_controller/.only.MCU_LPC175X_6X b/examples/host/hid_controller/.only.MCU_LPC175X_6X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/hid_controller/.only.MCU_LPC175X_6X
+++ /dev/null
diff --git a/examples/host/hid_controller/.only.MCU_LPC177X_8X b/examples/host/hid_controller/.only.MCU_LPC177X_8X
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/hid_controller/.only.MCU_LPC177X_8X
+++ /dev/null
diff --git a/examples/host/hid_controller/.only.MCU_LPC18XX b/examples/host/hid_controller/.only.MCU_LPC18XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/hid_controller/.only.MCU_LPC18XX
+++ /dev/null
diff --git a/examples/host/hid_controller/.only.MCU_LPC40XX b/examples/host/hid_controller/.only.MCU_LPC40XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/hid_controller/.only.MCU_LPC40XX
+++ /dev/null
diff --git a/examples/host/hid_controller/.only.MCU_LPC43XX b/examples/host/hid_controller/.only.MCU_LPC43XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/hid_controller/.only.MCU_LPC43XX
+++ /dev/null
diff --git a/examples/host/hid_controller/.only.MCU_MIMXRT10XX b/examples/host/hid_controller/.only.MCU_MIMXRT10XX
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/hid_controller/.only.MCU_MIMXRT10XX
+++ /dev/null
diff --git a/examples/host/hid_controller/.only.MCU_MSP432E4 b/examples/host/hid_controller/.only.MCU_MSP432E4
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/hid_controller/.only.MCU_MSP432E4
+++ /dev/null
diff --git a/examples/host/hid_controller/.only.MCU_RP2040 b/examples/host/hid_controller/.only.MCU_RP2040
deleted file mode 100644
index e69de29bb..000000000
--- a/examples/host/hid_controller/.only.MCU_RP2040
+++ /dev/null
diff --git a/examples/host/hid_controller/only.txt b/examples/host/hid_controller/only.txt
new file mode 100644
index 000000000..db9a337e5
--- /dev/null
+++ b/examples/host/hid_controller/only.txt
@@ -0,0 +1,8 @@
+mcu:LPC175X_6X
+mcu:LPC177X_8X
+mcu:LPC18XX
+mcu:LPC40XX
+mcu:LPC43XX
+mcu:MIMXRT10XX
+mcu:RP2040
+mcu:MSP432E4 \ No newline at end of file
diff --git a/hw/bsp/board_mcu.h b/hw/bsp/board_mcu.h
index f8b5c061c..b911e1e53 100644
--- a/hw/bsp/board_mcu.h
+++ b/hw/bsp/board_mcu.h
@@ -32,7 +32,7 @@
//--------------------------------------------------------------------+
// Low Level MCU header include. TinyUSB stack and example should be
-// platform independent and mostly doens't need to include this file.
+// platform independent and mostly doesn't need to include this file.
// However there are still certain situation where this file is needed:
// - FreeRTOSConfig.h to set up correct clock and NVIC interrupts for ARM Cortex
// - SWO logging for Cortex M with ITM_SendChar() / ITM_ReceiveChar()
@@ -146,6 +146,9 @@
#elif CFG_TUSB_MCU == OPT_MCU_TM4C123
#include "TM4C123.h"
+#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
+ // no header needed
+
#else
#error "Missing MCU header"
#endif
diff --git a/hw/bsp/raspberrypi4/boards/raspberrypi_cm4/board.h b/hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.h
index 1d3565d5c..1d3565d5c 100644
--- a/hw/bsp/raspberrypi4/boards/raspberrypi_cm4/board.h
+++ b/hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.h
diff --git a/hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.mk b/hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.mk
new file mode 100644
index 000000000..52e9e45c4
--- /dev/null
+++ b/hw/bsp/broadcom_32bit/boards/raspberrypi_zero_w/board.mk
@@ -0,0 +1,5 @@
+CFLAGS += -mcpu=arm1176jzf-s \
+ -DBCM_VERSION=2835 \
+ -DCFG_TUSB_MCU=OPT_MCU_BCM2835
+
+SUFFIX =
diff --git a/hw/bsp/raspberrypi4/family.c b/hw/bsp/broadcom_32bit/family.c
index ba0b2700a..f7a11fb49 100644
--- a/hw/bsp/raspberrypi4/family.c
+++ b/hw/bsp/broadcom_32bit/family.c
@@ -27,8 +27,9 @@
#include "bsp/board.h"
#include "board.h"
+#include "broadcom/cpu.h"
+#include "broadcom/gpio.h"
#include "broadcom/interrupts.h"
-#include "broadcom/io.h"
#include "broadcom/mmu.h"
#include "broadcom/caches.h"
#include "broadcom/vcmailbox.h"
@@ -37,9 +38,8 @@
#define LED_PIN 18
#define LED_STATE_ON 1
-// Button
-#define BUTTON_PIN 16
-#define BUTTON_STATE_ACTIVE 0
+// UART TX
+#define UART_TX_PIN 14
//--------------------------------------------------------------------+
// Forward USB interrupt events to TinyUSB IRQ Handler
@@ -62,14 +62,26 @@ void board_init(void)
init_caches();
// LED
- gpio_initOutputPinWithPullNone(LED_PIN);
+ gpio_set_function(LED_PIN, GPIO_FUNCTION_OUTPUT);
+ gpio_set_pull(LED_PIN, BP_PULL_NONE);
board_led_write(true);
- // Button
- // TODO
-
// Uart
- uart_init();
+ COMPLETE_MEMORY_READS;
+ AUX->ENABLES_b.UART_1 = true;
+
+ UART1->IER = 0;
+ UART1->CNTL = 0;
+ UART1->LCR_b.DATA_SIZE = UART1_LCR_DATA_SIZE_MODE_8BIT;
+ UART1->MCR = 0;
+ UART1->IER = 0;
+
+ uint32_t source_clock = vcmailbox_get_clock_rate_measured(VCMAILBOX_CLOCK_CORE);
+ UART1->BAUD = ((source_clock / (115200 * 8)) - 1);
+ UART1->CNTL |= UART1_CNTL_TX_ENABLE_Msk;
+ COMPLETE_MEMORY_READS;
+
+ gpio_set_function(UART_TX_PIN, GPIO_FUNCTION_ALT5);
// Turn on USB peripheral.
vcmailbox_set_power_state(VCMAILBOX_DEVICE_USB_HCD, true);
@@ -87,7 +99,7 @@ void board_init(void)
void board_led_write(bool state)
{
- gpio_setPinOutputBool(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
+ gpio_set_value(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
}
uint32_t board_button_read(void)
diff --git a/hw/bsp/broadcom_32bit/family.mk b/hw/bsp/broadcom_32bit/family.mk
new file mode 100644
index 000000000..98744c5d0
--- /dev/null
+++ b/hw/bsp/broadcom_32bit/family.mk
@@ -0,0 +1,46 @@
+MCU_DIR = hw/mcu/broadcom
+DEPS_SUBMODULES += $(MCU_DIR)
+
+include $(TOP)/$(BOARD_PATH)/board.mk
+
+CFLAGS += \
+ -Wall \
+ -O0 \
+ -ffreestanding \
+ -nostdlib \
+ -nostartfiles \
+ -mgeneral-regs-only \
+ -fno-exceptions \
+ -std=c17
+
+CROSS_COMPILE = arm-none-eabi-
+
+# mcu driver cause following warnings
+CFLAGS += -Wno-error=cast-qual
+
+SRC_C += \
+ src/portable/synopsys/dwc2/dcd_dwc2.c \
+ $(MCU_DIR)/broadcom/gen/interrupt_handlers.c \
+ $(MCU_DIR)/broadcom/gpio.c \
+ $(MCU_DIR)/broadcom/interrupts.c \
+ $(MCU_DIR)/broadcom/mmu.c \
+ $(MCU_DIR)/broadcom/caches.c \
+ $(MCU_DIR)/broadcom/vcmailbox.c
+
+SKIP_NANOLIB = 1
+
+LD_FILE = $(MCU_DIR)/broadcom/link$(SUFFIX).ld
+
+INC += \
+ $(TOP)/$(BOARD_PATH) \
+ $(TOP)/$(MCU_DIR)
+
+SRC_S += $(MCU_DIR)/broadcom/boot$(SUFFIX).S
+
+$(BUILD)/kernel$(SUFFIX).img: $(BUILD)/$(PROJECT).elf
+ $(OBJCOPY) -O binary $^ $@
+
+# Copy to kernel to netboot drive or SD card
+# Change destinaation to fit your need
+flash: $(BUILD)/kernel$(SUFFIX).img
+ @$(CP) $< /home/$(USER)/Documents/code/pi_tinyusb/boot_cpy
diff --git a/hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.h b/hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.h
new file mode 100644
index 000000000..1d3565d5c
--- /dev/null
+++ b/hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.h
@@ -0,0 +1,38 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020, Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#ifndef BOARD_H_
+#define BOARD_H_
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* BOARD_H_ */
diff --git a/hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.mk b/hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.mk
new file mode 100644
index 000000000..5706b8318
--- /dev/null
+++ b/hw/bsp/broadcom_64bit/boards/raspberrypi_cm4/board.mk
@@ -0,0 +1,3 @@
+CFLAGS += -mcpu=cortex-a72 \
+ -DBCM_VERSION=2711 \
+ -DCFG_TUSB_MCU=OPT_MCU_BCM2711
diff --git a/hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.h b/hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.h
new file mode 100644
index 000000000..1d3565d5c
--- /dev/null
+++ b/hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.h
@@ -0,0 +1,38 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2020, Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#ifndef BOARD_H_
+#define BOARD_H_
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#ifdef __cplusplus
+ }
+#endif
+
+#endif /* BOARD_H_ */
diff --git a/hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.mk b/hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.mk
new file mode 100644
index 000000000..3060b0571
--- /dev/null
+++ b/hw/bsp/broadcom_64bit/boards/raspberrypi_zero2w/board.mk
@@ -0,0 +1,3 @@
+CFLAGS += -mcpu=cortex-a53 \
+ -DBCM_VERSION=2837 \
+ -DCFG_TUSB_MCU=OPT_MCU_BCM2837
diff --git a/hw/bsp/broadcom_64bit/family.c b/hw/bsp/broadcom_64bit/family.c
new file mode 100644
index 000000000..f7a11fb49
--- /dev/null
+++ b/hw/bsp/broadcom_64bit/family.c
@@ -0,0 +1,156 @@
+/*
+ * The MIT License (MIT)
+ *
+ * Copyright (c) 2019 Ha Thach (tinyusb.org)
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * This file is part of the TinyUSB stack.
+ */
+
+#include "bsp/board.h"
+#include "board.h"
+
+#include "broadcom/cpu.h"
+#include "broadcom/gpio.h"
+#include "broadcom/interrupts.h"
+#include "broadcom/mmu.h"
+#include "broadcom/caches.h"
+#include "broadcom/vcmailbox.h"
+
+// LED
+#define LED_PIN 18
+#define LED_STATE_ON 1
+
+// UART TX
+#define UART_TX_PIN 14
+
+//--------------------------------------------------------------------+
+// Forward USB interrupt events to TinyUSB IRQ Handler
+//--------------------------------------------------------------------+
+void USB_IRQHandler(void)
+{
+ tud_int_handler(0);
+}
+
+//--------------------------------------------------------------------+
+// MACRO TYPEDEF CONSTANT ENUM
+//--------------------------------------------------------------------+
+
+//--------------------------------------------------------------------+
+// Board porting API
+//--------------------------------------------------------------------+
+void board_init(void)
+{
+ setup_mmu_flat_map();
+ init_caches();
+
+ // LED
+ gpio_set_function(LED_PIN, GPIO_FUNCTION_OUTPUT);
+ gpio_set_pull(LED_PIN, BP_PULL_NONE);
+ board_led_write(true);
+
+ // Uart
+ COMPLETE_MEMORY_READS;
+ AUX->ENABLES_b.UART_1 = true;
+
+ UART1->IER = 0;
+ UART1->CNTL = 0;
+ UART1->LCR_b.DATA_SIZE = UART1_LCR_DATA_SIZE_MODE_8BIT;
+ UART1->MCR = 0;
+ UART1->IER = 0;
+
+ uint32_t source_clock = vcmailbox_get_clock_rate_measured(VCMAILBOX_CLOCK_CORE);
+ UART1->BAUD = ((source_clock / (115200 * 8)) - 1);
+ UART1->CNTL |= UART1_CNTL_TX_ENABLE_Msk;
+ COMPLETE_MEMORY_READS;
+
+ gpio_set_function(UART_TX_PIN, GPIO_FUNCTION_ALT5);
+
+ // Turn on USB peripheral.
+ vcmailbox_set_power_state(VCMAILBOX_DEVICE_USB_HCD, true);
+
+ // Timer 1/1024 second tick
+ SYSTMR->CS_b.M1 = 1;
+ SYSTMR->C1 = SYSTMR->CLO + 977;
+ BP_EnableIRQ(TIMER_1_IRQn);
+
+ BP_SetPriority(USB_IRQn, 0x00);
+ BP_ClearPendingIRQ(USB_IRQn);
+ BP_EnableIRQ(USB_IRQn);
+ BP_EnableIRQs();
+}
+
+void board_led_write(bool state)
+{
+ gpio_set_value(LED_PIN, state ? LED_STATE_ON : (1-LED_STATE_ON));
+}
+
+uint32_t board_button_read(void)
+{
+ return 0;
+}
+
+int board_uart_read(uint8_t* buf, int len)
+{
+ (void) buf; (void) len;
+ return 0;
+}
+
+int board_uart_write(void const * buf, int len)
+{
+ for (int i = 0; i < len; i++) {
+ const char* cbuf = buf;
+ while (!UART1->STAT_b.TX_READY) {}
+ if (cbuf[i] == '\n') {
+ UART1->IO = '\r';
+ while (!UART1->STAT_b.TX_READY) {}
+ }
+ UART1->IO = cbuf[i];
+ }
+ return len;
+}
+
+#if CFG_TUSB_OS == OPT_OS_NONE
+volatile uint32_t system_ticks = 0;
+
+void TIMER_1_IRQHandler(void)
+{
+ system_ticks++;
+ SYSTMR->C1 += 977;
+ SYSTMR->CS_b.M1 = 1;
+}
+
+uint32_t board_millis(void)
+{
+ return system_ticks;
+}
+#endif
+
+void HardFault_Handler (void)
+{
+ // asm("bkpt");
+}
+
+// Required by __libc_init_array in startup code if we are compiling using
+// -nostdlib/-nostartfiles.
+void _init(void)
+{
+
+}
diff --git a/hw/bsp/raspberrypi4/family.mk b/hw/bsp/broadcom_64bit/family.mk
index c65070a71..723926734 100644
--- a/hw/bsp/raspberrypi4/family.mk
+++ b/hw/bsp/broadcom_64bit/family.mk
@@ -3,18 +3,16 @@ DEPS_SUBMODULES += $(MCU_DIR)
include $(TOP)/$(BOARD_PATH)/board.mk
-CC = clang
-
CFLAGS += \
- -mcpu=cortex-a72 \
-Wall \
-O0 \
-ffreestanding \
-nostdlib \
-nostartfiles \
- -std=c17 \
-mgeneral-regs-only \
- -DCFG_TUSB_MCU=OPT_MCU_BCM2711
+ -std=c17
+
+CROSS_COMPILE = aarch64-none-elf-
# mcu driver cause following warnings
CFLAGS += -Wno-error=cast-qual
@@ -22,25 +20,22 @@ CFLAGS += -Wno-error=cast-qual
SRC_C += \
src/portable/synopsys/dwc2/dcd_dwc2.c \
$(MCU_DIR)/broadcom/gen/interrupt_handlers.c \
+ $(MCU_DIR)/broadcom/gpio.c \
$(MCU_DIR)/broadcom/interrupts.c \
- $(MCU_DIR)/broadcom/io.c \
$(MCU_DIR)/broadcom/mmu.c \
$(MCU_DIR)/broadcom/caches.c \
$(MCU_DIR)/broadcom/vcmailbox.c
-
-CROSS_COMPILE = aarch64-none-elf-
-
SKIP_NANOLIB = 1
-LD_FILE = $(MCU_DIR)/broadcom/link.ld
+LD_FILE = $(MCU_DIR)/broadcom/link8.ld
INC += \
$(TOP)/$(BOARD_PATH) \
$(TOP)/$(MCU_DIR) \
$(TOP)/lib/CMSIS_5/CMSIS/Core_A/Include
-SRC_S += $(MCU_DIR)/broadcom/boot.S
+SRC_S += $(MCU_DIR)/broadcom/boot8.S
$(BUILD)/kernel8.img: $(BUILD)/$(PROJECT).elf
$(OBJCOPY) -O binary $^ $@
@@ -48,4 +43,4 @@ $(BUILD)/kernel8.img: $(BUILD)/$(PROJECT).elf
# Copy to kernel to netboot drive or SD card
# Change destinaation to fit your need
flash: $(BUILD)/kernel8.img
- $(CP) $< /home/$(USER)/Documents/code/pi4_tinyusb/boot_cpy
+ @$(CP) $< /home/$(USER)/Documents/code/pi_tinyusb/boot_cpy
diff --git a/hw/bsp/raspberrypi4/boards/raspberrypi_cm4/board.mk b/hw/bsp/raspberrypi4/boards/raspberrypi_cm4/board.mk
deleted file mode 100644
index 897342479..000000000
--- a/hw/bsp/raspberrypi4/boards/raspberrypi_cm4/board.mk
+++ /dev/null
@@ -1 +0,0 @@
-CFLAGS += -DBCM_VERSION=2711
diff --git a/hw/bsp/samd21/boards/curiosity_nano/.skip.device.net_lwip_webserver b/hw/bsp/samd21/boards/curiosity_nano/.skip.device.net_lwip_webserver
deleted file mode 100644
index e69de29bb..000000000
--- a/hw/bsp/samd21/boards/curiosity_nano/.skip.device.net_lwip_webserver
+++ /dev/null
diff --git a/hw/mcu/broadcom b/hw/mcu/broadcom
-Subproject 5bff1d5e02c37c38ee1e5cf3f7fe82fdc7e1517
+Subproject 08370086080759ed54ac1136d62d2ad24c6fa26
diff --git a/src/class/usbtmc/usbtmc_device.c b/src/class/usbtmc/usbtmc_device.c
index 4bd1edf12..26be987cf 100644
--- a/src/class/usbtmc/usbtmc_device.c
+++ b/src/class/usbtmc/usbtmc_device.c
@@ -235,17 +235,19 @@ void usbtmcd_init_cb(void)
usbtmc_state.capabilities = tud_usbtmc_get_capabilities_cb();
#ifndef NDEBUG
# if CFG_TUD_USBTMC_ENABLE_488
- if(usbtmc_state.capabilities->bmIntfcCapabilities488.supportsTrigger)
- TU_ASSERT(&tud_usbtmc_msg_trigger_cb != NULL,);
- // Per USB488 spec: table 8
- TU_ASSERT(!usbtmc_state.capabilities->bmIntfcCapabilities.listenOnly,);
- TU_ASSERT(!usbtmc_state.capabilities->bmIntfcCapabilities.talkOnly,);
+ if (usbtmc_state.capabilities->bmIntfcCapabilities488.supportsTrigger) {
+ TU_ASSERT(&tud_usbtmc_msg_trigger_cb != NULL,);
+ }
+ // Per USB488 spec: table 8
+ TU_ASSERT(!usbtmc_state.capabilities->bmIntfcCapabilities.listenOnly,);
+ TU_ASSERT(!usbtmc_state.capabilities->bmIntfcCapabilities.talkOnly,);
# endif
- if(usbtmc_state.capabilities->bmIntfcCapabilities.supportsIndicatorPulse)
- TU_ASSERT(&tud_usbtmc_indicator_pulse_cb != NULL,);
+ if (usbtmc_state.capabilities->bmIntfcCapabilities.supportsIndicatorPulse) {
+ TU_ASSERT(&tud_usbtmc_indicator_pulse_cb != NULL,);
+ }
#endif
- usbtmcLock = osal_mutex_create(&usbtmcLockBuffer);
+ usbtmcLock = osal_mutex_create(&usbtmcLockBuffer);
}
uint16_t usbtmcd_open_cb(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t max_len)
diff --git a/src/device/dcd_attr.h b/src/device/dcd_attr.h
index 3c5dadaf4..feba82ea9 100644
--- a/src/device/dcd_attr.h
+++ b/src/device/dcd_attr.h
@@ -190,7 +190,7 @@
#define DCD_ATTR_ENDPOINT_MAX 4
//------------- Broadcom -------------//
-#elif TU_CHECK_MCU(OPT_MCU_BCM2711)
+#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
#define DCD_ATTR_ENDPOINT_MAX 8
//------------- Broadcom -------------//
diff --git a/src/portable/synopsys/dwc2/dcd_dwc2.c b/src/portable/synopsys/dwc2/dcd_dwc2.c
index bb21b3dcd..188611743 100644
--- a/src/portable/synopsys/dwc2/dcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/dcd_dwc2.c
@@ -33,7 +33,8 @@
#if TUSB_OPT_DEVICE_ENABLED && \
( defined(DCD_ATTR_DWC2_STM32) || \
TU_CHECK_MCU(OPT_MCU_ESP32S2, OPT_MCU_ESP32S3, OPT_MCU_GD32VF103) || \
- TU_CHECK_MCU(OPT_MCU_EFM32GG, OPT_MCU_BCM2711, OPT_MCU_XMC4000) )
+ TU_CHECK_MCU(OPT_MCU_EFM32GG, OPT_MCU_BCM2711, OPT_MCU_BCM2835) || \
+ TU_CHECK_MCU(OPT_MCU_BCM2837, OPT_MCU_XMC4000) )
#include "device/dcd.h"
#include "dwc2_type.h"
@@ -44,7 +45,7 @@
#include "dwc2_esp32.h"
#elif TU_CHECK_MCU(OPT_MCU_GD32VF103)
#include "dwc2_gd32.h"
-#elif TU_CHECK_MCU(OPT_MCU_BCM2711)
+#elif TU_CHECK_MCU(OPT_MCU_BCM2711, OPT_MCU_BCM2835, OPT_MCU_BCM2837)
#include "dwc2_bcm.h"
#elif TU_CHECK_MCU(OPT_MCU_EFM32GG)
#include "dwc2_efm32.h"
diff --git a/src/portable/synopsys/dwc2/dwc2_bcm.h b/src/portable/synopsys/dwc2/dwc2_bcm.h
index 353bc21ee..14194e754 100644
--- a/src/portable/synopsys/dwc2/dwc2_bcm.h
+++ b/src/portable/synopsys/dwc2/dwc2_bcm.h
@@ -31,6 +31,7 @@
extern "C" {
#endif
+#include "broadcom/defines.h"
#include "broadcom/interrupts.h"
#include "broadcom/caches.h"
@@ -47,7 +48,6 @@ static inline void dwc2_dcd_int_enable(uint8_t rhport)
{
(void) rhport;
BP_EnableIRQ(USB_IRQn);
- __asm__ volatile("isb"); // needed if TIMER1 IRQ is not enabled !?
}
TU_ATTR_ALWAYS_INLINE
@@ -55,7 +55,6 @@ static inline void dwc2_dcd_int_disable (uint8_t rhport)
{
(void) rhport;
BP_DisableIRQ(USB_IRQn);
- __asm__ volatile("isb"); // needed if TIMER1 IRQ is not enabled !?
}
static inline void dwc2_remote_wakeup_delay(void)
diff --git a/src/tusb_option.h b/src/tusb_option.h
index 2edd310fa..c7c7b2454 100644
--- a/src/tusb_option.h
+++ b/src/tusb_option.h
@@ -132,6 +132,8 @@
// Broadcom
#define OPT_MCU_BCM2711 1700 ///< Broadcom BCM2711
+#define OPT_MCU_BCM2835 1701 ///< Broadcom BCM2835
+#define OPT_MCU_BCM2837 1702 ///< Broadcom BCM2837
// Infineon
#define OPT_MCU_XMC4000 1800 ///< Infineon XMC4000
diff --git a/tools/build_board.py b/tools/build_board.py
index 9397c754f..b2a80c680 100644
--- a/tools/build_board.py
+++ b/tools/build_board.py
@@ -4,6 +4,8 @@ import sys
import subprocess
import time
+import build_utils
+
SUCCEEDED = "\033[32msucceeded\033[0m"
FAILED = "\033[31mfailed\033[0m"
SKIPPED = "\033[33mskipped\033[0m"
@@ -50,7 +52,7 @@ def build_board(example, board):
sram_size = "-"
# Check if board is skipped
- if skip_example(example, board):
+ if build_utils.skip_example(example, board):
success = SKIPPED
skip_count += 1
print(build_format.format(example, board, success, '-', flash_size, sram_size))
@@ -82,33 +84,6 @@ def build_size(example, board):
sram_size = int(size_list[1]) + int(size_list[2])
return (flash_size, sram_size)
-def skip_example(example, board):
- ex_dir = 'examples/' + example
- board_mk = 'hw/bsp/{}/board.mk'.format(board)
- with open(board_mk) as mk:
- mk_contents = mk.read()
-
- # Skip all OPT_MCU_NONE these are WIP port
- if '-DCFG_TUSB_MCU=OPT_MCU_NONE' in mk_contents:
- return 1
-
- # Skip if CFG_TUSB_MCU in board.mk to match skip file
- for skip_file in glob.iglob(ex_dir + '/.skip.MCU_*'):
- mcu_cflag = '-DCFG_TUSB_MCU=OPT_' + os.path.basename(skip_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 1
-
- # Build only list, if exists only these MCU are built
- only_list = list(glob.iglob(ex_dir + '/.only.MCU_*'))
- if len(only_list) > 0:
- for only_file in only_list:
- mcu_cflag = '-DCFG_TUSB_MCU=OPT_' + os.path.basename(only_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 0
- return 1
-
- return 0
-
print(build_separator)
print(build_format.format('Example', 'Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM'))
diff --git a/tools/build_esp32sx.py b/tools/build_esp32sx.py
index 91953f080..2947a0a6b 100644
--- a/tools/build_esp32sx.py
+++ b/tools/build_esp32sx.py
@@ -4,6 +4,8 @@ import sys
import subprocess
import time
+import build_utils
+
SUCCEEDED = "\033[32msucceeded\033[0m"
FAILED = "\033[31mfailed\033[0m"
SKIPPED = "\033[33mskipped\033[0m"
@@ -51,7 +53,7 @@ def build_board(example, board):
sram_size = "-"
# Check if board is skipped
- if skip_example(example, board):
+ if build_utils.skip_example(example, board):
success = SKIPPED
skip_count += 1
print(build_format.format(example, board, success, '-', flash_size, sram_size))
@@ -83,9 +85,6 @@ def build_size(example, board):
sram_size = int(size_list[1]) + int(size_list[2])
return (flash_size, sram_size)
-def skip_example(example, board):
- return 0
-
print(build_separator)
print(build_format.format('Example', 'Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM'))
print(build_separator)
diff --git a/tools/build_family.py b/tools/build_family.py
index 4195c259b..4094d07db 100644
--- a/tools/build_family.py
+++ b/tools/build_family.py
@@ -4,6 +4,8 @@ import sys
import subprocess
import time
+import build_utils
+
SUCCEEDED = "\033[32msucceeded\033[0m"
FAILED = "\033[31mfailed\033[0m"
SKIPPED = "\033[33mskipped\033[0m"
@@ -38,7 +40,7 @@ all_examples.sort()
# If family are not specified in arguments, build all
all_families = []
for entry in os.scandir("hw/bsp"):
- if entry.is_dir() and os.path.isdir(entry.path + "/boards") and entry.name != "esp32s2" and entry.name != "esp32s3":
+ if entry.is_dir() and os.path.isdir(entry.path + "/boards") and entry.name not in ("esp32s2", "esp32s3"):
all_families.append(entry.name)
filter_with_input(all_families)
@@ -62,7 +64,7 @@ def build_board(example, board):
sram_size = "-"
# Check if board is skipped
- if skip_example(example, board):
+ if build_utils.skip_example(example, board):
success = SKIPPED
skip_count += 1
print(build_format.format(example, board, success, '-', flash_size, sram_size))
@@ -95,46 +97,6 @@ def build_size(example, board):
sram_size = int(size_list[1]) + int(size_list[2])
return (flash_size, sram_size)
-def skip_example(example, board):
- ex_dir = 'examples/' + example
-
- # Check if example is skipped by family or board directory
- skip_file = ".skip." + example.replace('/', '.');
- if os.path.isfile("hw/bsp/{}/{}".format(family, skip_file)) or os.path.isfile("hw/bsp/{}/boards/{}/{}".format(family, board, skip_file)):
- return 1
-
- # Otherwise check if mcu is excluded by example directory
-
- # family CMake
- family_mk = 'hw/bsp/{}/family.cmake'.format(family)
-
- # family.mk
- if not os.path.exists(family_mk):
- family_mk = 'hw/bsp/{}/family.mk'.format(family)
-
- with open(family_mk) as mk:
- mk_contents = mk.read()
-
- # Skip all OPT_MCU_NONE these are WIP port
- if 'CFG_TUSB_MCU=OPT_MCU_NONE' in mk_contents:
- return 1
-
- # Skip if CFG_TUSB_MCU in family.mk to match skip file
- for skip_file in glob.iglob(ex_dir + '/.skip.MCU_*'):
- mcu_cflag = 'CFG_TUSB_MCU=OPT_' + os.path.basename(skip_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 1
-
- # Build only list, if exists only these MCU are built
- only_list = list(glob.iglob(ex_dir + '/.only.MCU_*'))
- if len(only_list) > 0:
- for only_file in only_list:
- mcu_cflag = 'CFG_TUSB_MCU=OPT_' + os.path.basename(only_file).split('.')[2]
- if mcu_cflag in mk_contents:
- return 0
- return 1
- return 0
-
print(build_separator)
print(build_format.format('Example', 'Board', '\033[39mResult\033[0m', 'Time', 'Flash', 'SRAM'))
diff --git a/tools/build_utils.py b/tools/build_utils.py
new file mode 100644
index 000000000..299fffa4d
--- /dev/null
+++ b/tools/build_utils.py
@@ -0,0 +1,61 @@
+import pathlib
+
+def skip_example(example, board):
+ ex_dir = pathlib.Path('examples/') / example
+ bsp = pathlib.Path("hw/bsp")
+
+ board_dir = list(bsp.glob("*/boards/" + board))
+ if not board_dir:
+ # Skip unknown boards
+ return True
+
+ board_dir = list(board_dir)[0]
+
+ family_dir = board_dir.parent.parent
+ family = family_dir.name
+
+ # family CMake
+ family_mk = family_dir / "family.cmake"
+
+ # family.mk
+ if not family_mk.exists():
+ family_mk = family_dir / "family.mk"
+
+ mk_contents = family_mk.read_text()
+
+ # Find the mcu
+ if "CFG_TUSB_MCU=OPT_MCU_" not in mk_contents:
+ board_mk = board_dir / "board.cmake"
+ if not board_mk.exists():
+ board_mk = board_dir / "board.mk"
+
+ mk_contents = board_mk.read_text()
+
+ for token in mk_contents.split():
+ if "CFG_TUSB_MCU=OPT_MCU_" in token:
+ # Strip " because cmake files has them.
+ token = token.strip("\"")
+ _, opt_mcu = token.split("=")
+ mcu = opt_mcu[len("OPT_MCU_"):]
+
+ # Skip all OPT_MCU_NONE these are WIP port
+ if mcu == "NONE":
+ return True
+
+ skip_file = ex_dir / "skip.txt"
+ only_file = ex_dir / "only.txt"
+
+ if skip_file.exists() and only_file.exists():
+ raise RuntimeError("Only have a skip or only file. Not both.")
+ elif skip_file.exists():
+ skips = skip_file.read_text().split()
+ return ("mcu:" + mcu in skips or
+ "board:" + board in skips or
+ "family:" + family in skips)
+ elif only_file.exists():
+ onlys = only_file.read_text().split()
+ return not ("mcu:" + mcu in onlys or
+ "board:" + board in onlys or
+ "family:" + family in onlys)
+
+ return False