diff --git a/boards/beagle/beaglev_fire/beaglev_fire_common.dtsi b/boards/beagle/beaglev_fire/beaglev_fire_common.dtsi index 24b1958a9d9f1..086dabbed8470 100644 --- a/boards/beagle/beaglev_fire/beaglev_fire_common.dtsi +++ b/boards/beagle/beaglev_fire/beaglev_fire_common.dtsi @@ -14,6 +14,28 @@ compatible = "beagle,beaglev-fire", "microchip,mpfs"; aliases { }; + + beaglev { + #address-cells = <2>; + #size-cells = <1>; + + ddr_cached_high: memory@1000000000 { + compatible = "mmio-sram"; + reg = <0x10 0x00000000 0x80000000>; /* 2GB */ + }; + }; + + chosen { + zephyr,console = &uart0; + zephyr,shell-uart = &uart0; + zephyr,sram = &ddr_cached_high; + }; +}; + +&uart0 { + status = "okay"; + current-speed = <115200>; + clock-frequency = <150000000>; }; &gpio2 { diff --git a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_e51.dts b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_e51.dts index 5a8537124d4d9..e1556c095280a 100644 --- a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_e51.dts +++ b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_e51.dts @@ -21,16 +21,4 @@ status = "disabled"; }; }; - - chosen { - zephyr,console = &uart0; - zephyr,shell-uart = &uart0; - zephyr,sram = &sram1; - }; -}; - -&uart0 { - status = "okay"; - current-speed = <115200>; - clock-frequency = <150000000>; }; diff --git a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_e51.yaml b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_e51.yaml index bc5ee3de628b0..745c033310b98 100644 --- a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_e51.yaml +++ b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_e51.yaml @@ -4,7 +4,7 @@ type: mcu arch: riscv toolchain: - zephyr -ram: 3840 +ram: 2048000 testing: ignore_tags: - net diff --git a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54.dts b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54.dts index 7c4fba300fd3b..36513a8f6517d 100644 --- a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54.dts +++ b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54.dts @@ -5,21 +5,9 @@ model = "beagle,beaglev-fire"; compatible = "beagle,beaglev-fire", "microchip,mpfs"; - chosen { - zephyr,console = &uart1; - zephyr,shell-uart = &uart1; - zephyr,sram = &sram1; - }; - cpus { cpu@0 { status = "disabled"; }; }; }; - -&uart1 { - status = "okay"; - current-speed = <115200>; - clock-frequency = <150000000>; -}; diff --git a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54.yaml b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54.yaml index 9204225a7660f..e99022d4a1487 100644 --- a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54.yaml +++ b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54.yaml @@ -4,7 +4,7 @@ type: mcu arch: riscv toolchain: - zephyr -ram: 3840 +ram: 2048000 testing: ignore_tags: - net diff --git a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54_smp.dts b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54_smp.dts index cf9ed20aa3ee4..9d81bf66e06ec 100644 --- a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54_smp.dts +++ b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54_smp.dts @@ -4,16 +4,4 @@ / { model = "beagle,beaglev-fire"; compatible = "beagle,beaglev-fire", "microchip,mpfs"; - - chosen { - zephyr,console = &uart1; - zephyr,shell-uart = &uart1; - zephyr,sram = &sram1; - }; -}; - -&uart1 { - status = "okay"; - current-speed = <115200>; - clock-frequency = <150000000>; }; diff --git a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54_smp.yaml b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54_smp.yaml index e8f316014382d..809d7fd2c3ebc 100644 --- a/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54_smp.yaml +++ b/boards/beagle/beaglev_fire/beaglev_fire_polarfire_u54_smp.yaml @@ -4,7 +4,7 @@ type: mcu arch: riscv toolchain: - zephyr -ram: 3840 +ram: 2048000 testing: ignore_tags: - net diff --git a/boards/beagle/beaglev_fire/doc/index.rst b/boards/beagle/beaglev_fire/doc/index.rst index e5e28f8cf727a..4cc146f10a2b2 100644 --- a/boards/beagle/beaglev_fire/doc/index.rst +++ b/boards/beagle/beaglev_fire/doc/index.rst @@ -15,11 +15,17 @@ hobbyists, and researchers to explore and experiment with RISC-V technology. Building ======== +There are three board configurations provided for the BeagleV-Fire: + +* ``beaglev_fire/polarfire/e51``: Uses only the E51 core +* ``beaglev_fire/polarfire/u54``: Uses the U54 cores +* ``beaglev_fire/polarfire/u54/smp``: Uses the U54 cores with CONFIG_SMP=y + Applications for the ``beaglev_fire`` board configuration can be built as usual: .. zephyr-app-commands:: :zephyr-app: samples/hello_world - :board: beaglev_fire + :board: beaglev_fire/polarfire/u54 :goals: build Debugging @@ -76,3 +82,49 @@ and load the binary: load break main continue + +Flashing +======== +When using the PolarFire `Hart Software Services `_ along with Zephyr, you need to use the `hss-payload-generator `_ tool to generate an image that HSS can boot. + +.. code-block:: yaml + + set-name: 'ZephyrImage' + + # Define the entry point address for each hart (U54 cores) + hart-entry-points: + u54_1: '0x1000000000' + + # Define the payloads (ELF binaries or raw blobs) + payloads: + : + exec-addr: '0x1000000000' # Where Zephyr should be loaded + owner-hart: u54_1 # Primary hart that runs Zephyr + priv-mode: prv_m # Start in Machine mode + skip-opensbi: true # Boot directly without OpenSBI + +After generating the image, you can flash it to the board by restarting a board that's connected over USB and UART, interrupting the HSS boot process with a key press, and then running the ``mmc`` and ``usbdmsc`` commands: + +.. code-block:: bash + + Press a key to enter CLI, ESC to skip + Timeout in 1 second + .[6.304162] Character 100 pressed + [6.308415] Type HELP for list of commands + [6.313276] >> mmc + [10.450867] Selecting SDCARD/MMC (fallback) as boot source ... + [10.457550] Attempting to select eMMC ... Passed + [10.712708] >> usbdmsc + [14.732841] initialize MMC + [14.736400] Attempting to select eMMC ... Passed + [15.168707] MMC - 512 byte pages, 512 byte blocks, 30621696 pages + Waiting for USB Host to connect... (CTRL-C to quit) + . 0 bytes written, 0 bytes read + USB Host connected. Waiting for disconnect... (CTRL-C to quit) + / 0 bytes written, 219136 bytes read + +This will cause the board to appear as a USB mass storage device. You can then then flash the image with ``dd`` or other tools like `BalenaEtcher `_: + +.. code-block:: bash + + dd if= of=/dev/sdXD bs=4M status=progress oflag=sync