Skip to content

Commit

Permalink
Edits following code reivew
Browse files Browse the repository at this point in the history
  • Loading branch information
mubes committed Feb 25, 2020
1 parent 507db0f commit f89f2b9
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
strategy:
fail-fast: false
matrix:
boards: ['mimxrt1010_evk']
boards: ['mimxrt1010_evk','mimxrt1020_evk','versiboard2']
steps:
- name: Setup Node.js
uses: actions/setup-node@v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ In general entries in `hw/bsp/newboard/board.mk` should reference existing pinni

In general non-standard options are frowned upon because it changes the user experience of tinyUF2. However, on occasion these may be needed for specific reasons. The supported options are specified in `hw/bsp/<BOARD>/board_config.h` for a specific board. Not defining any of these options means sensible defaults will be applied;

* `USB_VID`: Vendor ID for the board. Default is 0x239A.
* `USB_VID`: Vendor ID for the board. Default is 0x239A, courtesy of Adafruit Industries.

* `USB_PID`: PID for the board. Default is 0x0058 which is specifically defined as a generic tinyUF2 boot device. Do not select something else unless you've been allocated a new number.
* `USB_PID`: PID for the board. Default is 0x0058 which is specifically defined as a generic tinyUF2 boot device. Do not select something else unless you've been allocated a new number by Adafruit.

* `VOLUME_LABEL`: Volume Label for the tinyUF2 drive. Default is `UF2BOOT`.

Expand Down
9 changes: 7 additions & 2 deletions hw/bsp/mimxrt1010_evk/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,15 @@
#define BOARD_FLASH_SIZE 0x800000

// LED
#define PINNING_LED_GPIO_11_H
#define PIN_LED IOMUXC_GPIO_11_GPIOMUX_IO11
#define LED_GPIO_PORT GPIO1
#define LED_GPIO_PIN 11
#define LED_STATE_ON 1

// UART
#define PINNING_UART_LPUART1_GPIO_09_10
#define UART_PORT LPUART1
#define PIN_UART_RX IOMUXC_GPIO_09_LPUART1_RXD
#define PIN_UART_TX IOMUXC_GPIO_10_LPUART1_TXD

// QSPI
#define PINNING_QSPI_FLEXSPIA
Expand Down
9 changes: 7 additions & 2 deletions hw/bsp/mimxrt1020_evk/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
#define BOARD_FLASH_SIZE 0x800000

// LED
#define PINNING_LED_AD_B0_05
#define PIN_LED IOMUXC_GPIO_AD_B0_05_GPIO1_IO05
#define LED_GPIO_PORT GPIO1
#define LED_GPIO_PIN 05
#define LED_STATE_ON 0

// UART
#define PINNING_UART_LPUART1_AD_B0_06_07
#define UART_PORT LPUART1
#define PIN_UART_RX IOMUXC_GPIO_AD_B0_07_LPUART1_RX
#define PIN_UART_TX IOMUXC_GPIO_AD_B0_06_LPUART1_TX

// QSPI
#define PINNING_QSPI_FLEXSPIA
Expand Down
9 changes: 7 additions & 2 deletions hw/bsp/versiboard2/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@
#define BOARD_FLASH_SIZE 0x800000

// LED
#define PINNING_LED_EMC_04
#define PIN_LED IOMUXC_GPIO_EMC_04_GPIO2_IO04
#define LED_GPIO_PORT GPIO2
#define LED_GPIO_PIN 04
#define LED_STATE_ON 1

// UART
#define PINNING_UART_LPUART1_AD_B0_06_07
#define UART_PORT LPUART1
#define PIN_UART_RX IOMUXC_GPIO_AD_B0_07_LPUART1_RX
#define PIN_UART_TX IOMUXC_GPIO_AD_B0_06_LPUART1_TX

// Connection to QSPI
#define PINNING_QSPI_FLEXSPIA_ALTERNATE
Expand Down
17 changes: 11 additions & 6 deletions hw/chip/mimxrt10xx/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,24 +311,24 @@ void board_init(void)
usb_phy->TX = phytx;

//----------- FLEXSPI ----------//
IOMUXC_SetPinMux(PIN_SS0, PIN_SS0_MUX);
IOMUXC_SetPinMux(PIN_SS0, PIN_SS0_MUX);
IOMUXC_SetPinMux(PIN_DATA1, PIN_DATA1_MUX);
IOMUXC_SetPinMux(PIN_DATA2, PIN_DATA2_MUX);
IOMUXC_SetPinMux(PIN_DATA0, PIN_DATA0_MUX);
IOMUXC_SetPinMux(PIN_SCLK, PIN_SCLK_MUX);
IOMUXC_SetPinMux(PIN_SCLK, PIN_SCLK_MUX);
IOMUXC_SetPinMux(PIN_DATA3, PIN_DATA3_MUX);
#ifdef PIN_DQS
IOMUXC_SetPinMux(PIN_DQS, PIN_DQS_MUX);
IOMUXC_SetPinMux(PIN_DQS, PIN_DQS_MUX);
#endif

IOMUXC_SetPinConfig(PIN_SS0, PIN_SS0_CFG);
IOMUXC_SetPinConfig(PIN_SS0, PIN_SS0_CFG);
IOMUXC_SetPinConfig(PIN_DATA1, PIN_DATA1_CFG);
IOMUXC_SetPinConfig(PIN_DATA2, PIN_DATA2_CFG);
IOMUXC_SetPinConfig(PIN_DATA0, PIN_DATA0_CFG);
IOMUXC_SetPinConfig(PIN_SCLK, PIN_SCLK_CFG);
IOMUXC_SetPinConfig(PIN_SCLK, PIN_SCLK_CFG);
IOMUXC_SetPinConfig(PIN_DATA3, PIN_DATA3_CFG);
#ifdef PIN_DQS
IOMUXC_SetPinConfig(PIN_DQS, PIN_DQS_CFG);
IOMUXC_SetPinConfig(PIN_DQS, PIN_DQS_CFG);
#endif
SCB_DisableDCache();

Expand Down Expand Up @@ -389,6 +389,11 @@ extern uint32_t _bootloader_dbl_tap;
void board_check_app_start(void)

{
// This is the inital check to make sure we're not in the process
// of rebooting for a clean start of the application. This is
// deliberately done before any chip configuration so the application
// receives control of a chip in a as-close-to-clean condition as possible,

register uint32_t app_start_address = *(uint32_t *)(APP_START_ADDRESS + 4);

if (_bootloader_dbl_tap != DBL_TAP_MAGIC_QUICK_BOOT)
Expand Down
37 changes: 18 additions & 19 deletions hw/chip/mimxrt10xx/mimxrt101x/pinning_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,37 +28,36 @@

// UART Options =====================================

#if defined(PINNING_UART_LPUART1_GPIO_09_10)
// Default drive and MUX options for the UART if none are
// provided in the board_config.h

#define UART_PORT LPUART1
#define PIN_UART_RX IOMUXC_GPIO_09_LPUART1_RXD
#ifndef PIN_UART_RX_MUX
#define PIN_UART_RX_MUX 0U
#define PIN_UART_RX_CFG 0x10B0u
#define PIN_UART_TX IOMUXC_GPIO_10_LPUART1_TXD
#define PIN_UART_TX_MUX 0U
#define PIN_UART_TX_CFG 0x10B0u
#endif

#else
#ifndef PIN_UART_RX_CFG
#define PIN_UART_RX_CFG 0x10B0u
#endif

#error No UART pinning set
#ifndef PIN_UART_TX_MUX
#define PIN_UART_TX_MUX 0U
#endif

#ifndef PIN_UART_TX_CFG
#define PIN_UART_TX_CFG 0x10B0u
#endif

// LED Options ======================================

#if defined(PINNING_LED_GPIO_11_H)
// Default drive and MUX options for the LED used for status indication
// if none are provided in the board_config.h

#define PIN_LED IOMUXC_GPIO_11_GPIOMUX_IO11
#ifndef PIN_LED_MUX
#define PIN_LED_MUX 0U
#define PIN_LED_CFG 0x10B0U
#define LED_GPIO_PORT GPIO1
#define LED_GPIO_PIN 11
#define LED_STATE_ON 1

#else

#error No LED pinning set
#endif

#ifndef PIN_LED_CFG
#define PIN_LED_CFG 0x10B0U
#endif

// QSPI Options =====================================
Expand Down
45 changes: 17 additions & 28 deletions hw/chip/mimxrt10xx/mimxrt102x/pinning_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,47 +28,36 @@

// UART Options =====================================

#if defined(PINNING_UART_LPUART1_AD_B0_06_07)
// Default drive and MUX options for the UART if none are
// provided in the board_config.h

#define UART_PORT LPUART1
#define PIN_UART_RX IOMUXC_GPIO_AD_B0_07_LPUART1_RX
#ifndef PIN_UART_RX_MUX
#define PIN_UART_RX_MUX 2U
#define PIN_UART_RX_CFG 0x10B0u
#define PIN_UART_TX IOMUXC_GPIO_AD_B0_06_LPUART1_TX
#define PIN_UART_TX_MUX 2U
#define PIN_UART_TX_CFG 0x10B0u
#endif

#else
#ifndef PIN_UART_RX_CFG
#define PIN_UART_RX_CFG 0x10B0u
#endif

#error No UART pinning set
#ifndef PIN_UART_TX_MUX
#define PIN_UART_TX_MUX 2U
#endif

#ifndef PIN_UART_TX_CFG
#define PIN_UART_TX_CFG 0x10B0u
#endif

// LED Options ======================================

// LED used for status indication
#if defined(PINNING_LED_AD_B0_05)
// Default drive and MUX options for the LED used for status indication
// if none are provided in the board_config.h

#define PIN_LED IOMUXC_GPIO_AD_B0_05_GPIO1_IO05
#ifndef PIN_LED_MUX
#define PIN_LED_MUX 0U
#define PIN_LED_CFG 0x10B0U
#define LED_GPIO_PORT GPIO1
#define LED_GPIO_PIN 05
#define LED_STATE_ON 0

#elif defined(PINNING_LED_EMC_04)
#endif

#define PIN_LED IOMUXC_GPIO_EMC_04_GPIO2_IO04
#define PIN_LED_MUX 5U
#ifndef PIN_LED_CFG
#define PIN_LED_CFG 0x10B0U
#define LED_GPIO_PORT GPIO2
#define LED_GPIO_PIN 04
#define LED_STATE_ON 1

#else

#error No LED pinning set

#endif

// QSPI Options =====================================
Expand Down

0 comments on commit f89f2b9

Please sign in to comment.