boards: arm: Add Legend 2.5" boards
This commit adds support for the Legend 2.5" boards (legend25_ssd and legend25_hdd) based on the STM32F070CB MCU. These boards can be found in the Seagate FireCuda Gaming Drive, Gaming Drive for Xbox, SSD Gaming Drive for Xbox, and Gaming Drive for PlayStation devices. Both boards contain the following hardware components: - A B1414 LED strip connected to the PA7 pin (SPI MOSI) - A SPI flash (FM25F005) connected on SPI2 bus The Legend 2.5" HDD board also contains an activity LED connected on TIM3 CH3 Signed-off-by: Maxime Bittan <maxime.bittan@seagate.com> Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
This commit is contained in:
parent
ae0ef7e56a
commit
39614b8960
|
@ -100,6 +100,7 @@
|
|||
/boards/arm/hexiwear*/ @MaureenHelm @mmahadevan108 @dleach02
|
||||
/boards/arm/hexiwear*/doc/ @MaureenHelm @MeganHansen
|
||||
/boards/arm/ip_k66f/ @parthitce @lmajewski
|
||||
/boards/arm/legend/ @mbittan @simonguinot
|
||||
/boards/arm/lpcxpresso*/ @MaureenHelm @mmahadevan108 @dleach02
|
||||
/boards/arm/lpcxpresso*/doc/ @MaureenHelm @MeganHansen
|
||||
/boards/arm/mimx8mm_evk/ @Mani-Sadhasivam
|
||||
|
|
8
boards/arm/legend/Kconfig.board
Normal file
8
boards/arm/legend/Kconfig.board
Normal file
|
@ -0,0 +1,8 @@
|
|||
# Legend board family configuration
|
||||
|
||||
# Copyright (c) 2021 Seagate Technology
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
config BOARD_LEGEND
|
||||
bool "Legend board"
|
||||
depends on SOC_STM32F070XB
|
15
boards/arm/legend/Kconfig.defconfig
Normal file
15
boards/arm/legend/Kconfig.defconfig
Normal file
|
@ -0,0 +1,15 @@
|
|||
# Legend board family configuration
|
||||
|
||||
# Copyright (c) 2021, Seagate Technology LLC
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
if BOARD_LEGEND
|
||||
|
||||
config BOARD
|
||||
default "legend"
|
||||
|
||||
config SPI_STM32_INTERRUPT
|
||||
default y
|
||||
depends on SPI
|
||||
|
||||
endif # BOARD_LEGEND
|
6
boards/arm/legend/board.cmake
Normal file
6
boards/arm/legend/board.cmake
Normal file
|
@ -0,0 +1,6 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
board_runner_args(jlink "--device=STM32F070CB" "--speed=4000")
|
||||
|
||||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
|
||||
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
|
BIN
boards/arm/legend/doc/img/firecuda_gaming_hard_drive.png
Normal file
BIN
boards/arm/legend/doc/img/firecuda_gaming_hard_drive.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 KiB |
131
boards/arm/legend/doc/index.rst
Normal file
131
boards/arm/legend/doc/index.rst
Normal file
|
@ -0,0 +1,131 @@
|
|||
.. _legend:
|
||||
|
||||
Legend
|
||||
######
|
||||
|
||||
Overview
|
||||
********
|
||||
The Legend board family contains two revisions: 25hdd and 25ssd.
|
||||
|
||||
The Legend 2.5" HDD board (revision 25hdd) can be found in the Seagate FireCuda
|
||||
Gaming Hard Drive, Gaming Drive for Xbox and Gaming Drive for PlayStation
|
||||
devices. A 2.5" drive and two chips are embedded: an ASMedia ASM1153 USB-to-SATA
|
||||
bridge controller and a STM32F070 MCU. The former is handling the USB to HDD I/Os
|
||||
while the latter is dedicated to the LED effects. The two chips are connected
|
||||
together through I2C.
|
||||
|
||||
The Legend 2.5" SSD board (revision 25ssd) is found in the Seagate SSD Gaming
|
||||
Drive for Xbox. A Realtek RTS5411S USB hub is embedded and connected to a Phison
|
||||
U17 2.5" SSD, as well as a STM32F070 MCU.
|
||||
|
||||
On both boards, the Zephyr port is running on the STM32F070 MCU.
|
||||
|
||||
.. image:: img/firecuda_gaming_hard_drive.png
|
||||
:width: 750px
|
||||
:align: center
|
||||
:alt: Seagate FireCuda Gaming Hard Drive
|
||||
|
||||
Hardware
|
||||
********
|
||||
|
||||
- STM32F070cb MCU:
|
||||
|
||||
- ARM Cortex-M0+
|
||||
- 16KB SRAM
|
||||
- 128KB on-chip flash
|
||||
|
||||
- External devices connected to the STM32F070cb MCU:
|
||||
|
||||
- ASMedia ASM1153 USB-to-SATA bridge (I2C master on port 1) (HDD only)
|
||||
- 6 (hdd) or 4 (ssd) Everlight B1414 LEDs connected on SPI1 MOSI
|
||||
- 1 white LED (HDD only)
|
||||
- 64KB external SPI flash connected on SPI2
|
||||
|
||||
Supported Features
|
||||
==================
|
||||
|
||||
All the hardware features available on the Legend 2.5" boards are supported by
|
||||
Zephyr.
|
||||
|
||||
+-----------+------------+-------------------------------------+
|
||||
| Interface | Controller | Driver/Component |
|
||||
+===========+============+=====================================+
|
||||
| NVIC | on-chip | nested vector interrupt controller |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SYSTICK | on-chip | systick |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| CLOCK | on-chip | clock and reset control |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| GPIO | on-chip | gpio |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| I2C | on-chip | i2c master/slave controller |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| UART | on-chip | serial |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| SPI flash | on-chip | spi_nor |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| LED strip | on-chip | ws2812 |
|
||||
+-----------+------------+-------------------------------------+
|
||||
| USB | on-chip | usb |
|
||||
+-----------+------------+-------------------------------------+
|
||||
|
||||
|
||||
Connections and IOs
|
||||
===================
|
||||
|
||||
+---------+-----------------+----------------------------+
|
||||
| Name | Function | Usage |
|
||||
+=========+=================+============================+
|
||||
| PB6 | I2C1 | I2C1 SCL (HDD only) |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PB7 | I2C1 | I2C1 SDA (HDD only) |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PA10 | UART | USART0 RX |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PA9 | UART | USART0 TX |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PB0 | PWM | Activity LED (HDD only) |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PB12 | SPI2 | SPI2 Enable |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PB13 | SPI2 | SPI2 Clock |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PB14 | SPI2 | SPI2 MISO |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PB15 | SPI2 | SPI2 MOSI |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PA7 | LED strip | SPI1 MOSI |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PA12 | USB | USB DM (SSD only) |
|
||||
+---------+-----------------+----------------------------+
|
||||
| PA13 | USB | USB DP (SSD only) |
|
||||
+---------+-----------------+----------------------------+
|
||||
|
||||
Programming and Debugging
|
||||
*************************
|
||||
|
||||
Flashing
|
||||
========
|
||||
|
||||
The STM32F070cb MCU can be flashed by connecting an external debug probe to the
|
||||
SWD port (on-board 4-pin header). In the default OpenOCD configuration, the
|
||||
ST Link interface is selected. You may need to replace it with the interface of
|
||||
your debug probe.
|
||||
|
||||
Once the debug probe is connected to both the Legend board and your host
|
||||
computer, then you can simply run the ``west flash`` command to write a firmware
|
||||
image into flash.
|
||||
|
||||
Debugging
|
||||
=========
|
||||
|
||||
Please refer to the `Flashing`_ section and run the ``west debug`` command
|
||||
instead of ``west flash``.
|
||||
|
||||
References
|
||||
**********
|
||||
|
||||
- `STM32F070 reference manual`_
|
||||
|
||||
.. _STM32F070 reference manual:
|
||||
http://www.st.com/resource/en/reference_manual/dm00031936.pdf
|
191
boards/arm/legend/legend.dts
Normal file
191
boards/arm/legend/legend.dts
Normal file
|
@ -0,0 +1,191 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Seagate Technology LLC
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
#include <st/f0/stm32f070Xb.dtsi>
|
||||
#include <st/f0/stm32f070cbtx-pinctrl.dtsi>
|
||||
#include <dt-bindings/led/led.h>
|
||||
#include <dt-bindings/led/seagate_legend_b1414.h>
|
||||
|
||||
/ {
|
||||
chosen {
|
||||
zephyr,console = &usart1;
|
||||
zephyr,shell-uart = &usart1;
|
||||
zephyr,sram = &sram0;
|
||||
zephyr,flash = &flash0;
|
||||
};
|
||||
|
||||
aliases {
|
||||
watchdog0 = &iwdg;
|
||||
};
|
||||
|
||||
board_id: brd-id {
|
||||
compatible = "gpio-keys";
|
||||
brd_id0: brd_id_0 {
|
||||
label = "BRD_ID_0";
|
||||
gpios = <&gpioc 13 0>;
|
||||
};
|
||||
brd_id1: brd_id_1 {
|
||||
label = "BRD_ID_1";
|
||||
gpios = <&gpioc 14 0>;
|
||||
};
|
||||
brd_id2: brd_id_2 {
|
||||
label = "BRD_ID_2";
|
||||
gpios = <&gpioc 15 0>;
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
&usart1 {
|
||||
pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
|
||||
current-speed = <115200>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&i2c1 {
|
||||
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
|
||||
clock-frequency = <I2C_BITRATE_STANDARD>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&spi1 {
|
||||
pinctrl-0 = <&spi1_sck_pa5 &spi1_miso_pa6 &spi1_mosi_pa7>;
|
||||
dmas = <&dma1 3 0x20440>, <&dma1 2 0x20480>;
|
||||
dma-names = "tx", "rx";
|
||||
status = "okay";
|
||||
|
||||
led_strip_spi: b1414@0 {
|
||||
compatible = "everlight,b1414", "worldsemi,ws2812-spi";
|
||||
label = "B1414";
|
||||
|
||||
/* SPI */
|
||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||
spi-max-frequency = <SPI_FREQ>;
|
||||
|
||||
/* B1414 */
|
||||
spi-one-frame = <ONE_FRAME>;
|
||||
spi-zero-frame = <ZERO_FRAME>;
|
||||
color-mapping = <LED_COLOR_ID_RED>,
|
||||
<LED_COLOR_ID_GREEN>,
|
||||
<LED_COLOR_ID_BLUE>;
|
||||
reset-delay = <250>;
|
||||
};
|
||||
};
|
||||
|
||||
&spi2 {
|
||||
pinctrl-0 = <&spi2_sck_pb13 &spi2_miso_pb14 &spi2_mosi_pb15>;
|
||||
cs-gpios = <&gpiob 12 GPIO_ACTIVE_LOW>;
|
||||
status = "okay";
|
||||
|
||||
spi_nor: spi_nor@0 {
|
||||
status = "okay";
|
||||
compatible = "jedec,spi-nor";
|
||||
reg = <0>;
|
||||
spi-max-frequency = <8000000>;
|
||||
label = "SPI_FLASH_0";
|
||||
size = <1048576>;
|
||||
/*
|
||||
* Main flash source
|
||||
*
|
||||
* Vendor : Puya
|
||||
* Model : P25Q21H
|
||||
* Total size : 256 KB
|
||||
* Erase size : whole chip, 64 and 32 KB blocks, 4 KB sectors,
|
||||
* 256 B pages
|
||||
* Write size : up to 256 B (page size)
|
||||
* Lifetime : 100K erase/program cycles on each sector/block
|
||||
*/
|
||||
jedec-id = [85 40 12];
|
||||
/*
|
||||
* Alternate flash source
|
||||
*
|
||||
* Vendor : Fudan
|
||||
* Model : FM25F01B
|
||||
* Total size : 128 KB
|
||||
* Erase size : whole chip, 64 and 32 KB blocks, 4 KB sectors
|
||||
* Write size : up to 256 B (page size)
|
||||
* Lifetime : 100K erase/program cycles on each sector/block
|
||||
*
|
||||
* jedec-id = [a1 31 11];
|
||||
*
|
||||
* Model only found in first Jordan (2"5) EVT revision
|
||||
*
|
||||
* Vendor : Fudan
|
||||
* Model : FM25F005
|
||||
* Total size : 64 KB
|
||||
* Erase size : whole chip, 64 and 32 KB blocks, 4 KB sectors
|
||||
*
|
||||
* jedec-id = [a1 31 10];
|
||||
*/
|
||||
partitions {
|
||||
compatible = "fixed-partitions";
|
||||
#address-cells = <1>;
|
||||
#size-cells = <1>;
|
||||
|
||||
product_info: partition@0 {
|
||||
label = "product-info";
|
||||
reg = <0x00000000 0x1000>;
|
||||
};
|
||||
led_das: partition@10000 {
|
||||
label = "led-das";
|
||||
reg = <0x00001000 0x0000f000>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&spi_nor {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&dma1 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&timers3 {
|
||||
pwm3: pwm {
|
||||
pinctrl-0 = <&tim3_ch3_pb0>;
|
||||
/*
|
||||
* The maximum period needed on Legend devices for activity LED
|
||||
* hardware blinking is 250ms (i.e. "error" fast blink at 4 Hz).
|
||||
*
|
||||
* We can use the following equation to compute the
|
||||
* corresponding prescaler value:
|
||||
*
|
||||
* period_max = counter_size / cycles_per_second
|
||||
*
|
||||
* With:
|
||||
*
|
||||
* cycles_per_second = 48 MHz / (prescaler + 1)
|
||||
* counter_size = 2^16
|
||||
* period_max = 0.25
|
||||
*
|
||||
* Which gives:
|
||||
*
|
||||
* prescaler = 48 MHz * 0.25 / 2^16 + 1 = 182
|
||||
*
|
||||
* So any prescaler value above 182 is good for a 4 Hz hardware
|
||||
* blinking. In addition the PWM frequency must be as high as
|
||||
* possible to fool eyes and cameras with steady brightness
|
||||
* levels.
|
||||
*/
|
||||
st,prescaler = <200>;
|
||||
status = "disabled";
|
||||
};
|
||||
};
|
||||
|
||||
&gpiod {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&gpiof {
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&iwdg {
|
||||
status = "okay";
|
||||
};
|
19
boards/arm/legend/legend.yaml
Normal file
19
boards/arm/legend/legend.yaml
Normal file
|
@ -0,0 +1,19 @@
|
|||
identifier: legend
|
||||
name: Legend
|
||||
type: mcu
|
||||
arch: arm
|
||||
ram: 16
|
||||
flash: 128
|
||||
toolchain:
|
||||
- zephyr
|
||||
- gnuarmemb
|
||||
- xtools
|
||||
supported:
|
||||
- gpio
|
||||
- i2c
|
||||
- pwm
|
||||
- spi
|
||||
testing:
|
||||
ignore_tags:
|
||||
- net
|
||||
- bluetooth
|
56
boards/arm/legend/legend_25hdd.overlay
Normal file
56
boards/arm/legend/legend_25hdd.overlay
Normal file
|
@ -0,0 +1,56 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Seagate Technology LLC
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
model = "Seagate Legend 2.5 HDD board";
|
||||
compatible = "legend25_hdd", "seagate,legend25_hdd";
|
||||
|
||||
aliases {
|
||||
pwm-led0 = &pwm_led0;
|
||||
led-strip = &led_strip_spi;
|
||||
};
|
||||
|
||||
led_pwm: pwmleds {
|
||||
compatible = "pwm-leds";
|
||||
label = "LED PWM";
|
||||
|
||||
pwm_led0: pwm_led_0 {
|
||||
label = "Activity LED";
|
||||
pwms = <&pwm3 3 255 PWM_POLARITY_NORMAL>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&clk_hsi {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pll {
|
||||
clocks = <&clk_hsi>;
|
||||
prediv = <1>;
|
||||
mul = <6>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rcc {
|
||||
clocks = <&pll>;
|
||||
clock-frequency = <DT_FREQ_M(48)>;
|
||||
ahb-prescaler = <1>;
|
||||
apb1-prescaler = <1>;
|
||||
};
|
||||
|
||||
&led_strip_spi {
|
||||
chain-length = <6>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&timers3 {
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pwm3 {
|
||||
status = "okay";
|
||||
};
|
42
boards/arm/legend/legend_25ssd.overlay
Normal file
42
boards/arm/legend/legend_25ssd.overlay
Normal file
|
@ -0,0 +1,42 @@
|
|||
/*
|
||||
* Copyright (c) 2021 Seagate Technology LLC
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/ {
|
||||
model = "Seagate Legend 2.5 SSD board";
|
||||
compatible = "legend25_ssd", "seagate,legend25_ssd";
|
||||
|
||||
aliases {
|
||||
led-strip = &led_strip_spi;
|
||||
};
|
||||
};
|
||||
|
||||
&clk_hse {
|
||||
clock-frequency = <DT_FREQ_M(24)>; /* 24MHz external clock */
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&pll {
|
||||
clocks = <&clk_hse>;
|
||||
prediv = <1>;
|
||||
mul = <2>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&rcc {
|
||||
clocks = <&pll>;
|
||||
clock-frequency = <DT_FREQ_M(48)>;
|
||||
ahb-prescaler = <1>;
|
||||
apb1-prescaler = <1>;
|
||||
};
|
||||
|
||||
&led_strip_spi {
|
||||
chain-length = <4>;
|
||||
status = "okay";
|
||||
};
|
||||
|
||||
&usb {
|
||||
status = "okay";
|
||||
};
|
23
boards/arm/legend/legend_defconfig
Normal file
23
boards/arm/legend/legend_defconfig
Normal file
|
@ -0,0 +1,23 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
# Zephyr Kernel Configuration
|
||||
CONFIG_SOC_SERIES_STM32F0X=y
|
||||
|
||||
# Platform Configuration
|
||||
CONFIG_SOC_STM32F070XB=y
|
||||
|
||||
# Serial Drivers
|
||||
CONFIG_SERIAL=y
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||
# enable console
|
||||
CONFIG_CONSOLE=y
|
||||
CONFIG_UART_CONSOLE=y
|
||||
|
||||
# Pinmux Driver
|
||||
CONFIG_PINMUX=y
|
||||
|
||||
# GPIO Controller
|
||||
CONFIG_GPIO=y
|
||||
|
||||
# Clock Control
|
||||
CONFIG_CLOCK_CONTROL=y
|
8
boards/arm/legend/revision.cmake
Normal file
8
boards/arm/legend/revision.cmake
Normal file
|
@ -0,0 +1,8 @@
|
|||
set(LEGEND_REVISIONS "25hdd" "25ssd")
|
||||
if (NOT DEFINED BOARD_REVISION)
|
||||
set(BOARD_REVISION "25hdd")
|
||||
else()
|
||||
if (NOT BOARD_REVISION IN_LIST LEGEND_REVISIONS)
|
||||
message(FATAL_ERROR "${BOARD_REVISION} is not a valid revision for Legend. Accepted revisions: ${LEGEND_REVISIONS}")
|
||||
endif()
|
||||
endif()
|
12
boards/arm/legend/support/openocd.cfg
Normal file
12
boards/arm/legend/support/openocd.cfg
Normal file
|
@ -0,0 +1,12 @@
|
|||
source [find board/st_nucleo_f0.cfg]
|
||||
|
||||
$_TARGETNAME configure -event gdb-attach {
|
||||
echo "Debugger attaching: halting execution"
|
||||
reset halt
|
||||
gdb_breakpoint_override hard
|
||||
}
|
||||
|
||||
$_TARGETNAME configure -event gdb-detach {
|
||||
echo "Debugger detaching: resuming execution"
|
||||
resume
|
||||
}
|
20
include/dt-bindings/led/seagate_legend_b1414.h
Normal file
20
include/dt-bindings/led/seagate_legend_b1414.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Seagate Technology LLC
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#ifndef ZEPHYR_SAMPLES_DRIVERS_LED_B1414_H_
|
||||
#define ZEPHYR_SAMPLES_DRIVERS_LED_B1414_H_
|
||||
|
||||
/*
|
||||
* At 6 MHz: 1 bit in 166.666 ns
|
||||
* 1200 ns -> 7.2 bits
|
||||
* 300 ns -> 1.8 bits
|
||||
* 900 ns -> 5.4 bits
|
||||
*/
|
||||
#define SPI_FREQ 6000000
|
||||
#define ZERO_FRAME 0x60
|
||||
#define ONE_FRAME 0x7C
|
||||
|
||||
#endif
|
Loading…
Reference in a new issue