Skip to contentSkip to conversation

arm: Add nRF51 SoC and micro:bit machine

PATCH Applied Joel Stanley 3 participants 6 messages Aug 31, 2018 – Sep 25, 2018

lore
Share & tools
lore
#0 lore raw

v6 cover arm: Add nRF51 SoC and micro:bit machine

v6: Rework based on Peter's review
v5: Change back to ARMv7M from ARMMProfile
v4: Fix number of IRQs
v3: Rebase on Stefan's cortex-m0 series
v2: Addresses review from Peter and Stefan

This short series implements a minimal definition of the Nordic Semiconductor nRF51, a Cortex-M0 ARM SoC, and the BBC micro:bit, a machine that will use this SoC.

Joel Stanley (3):
MAINTAINERS: Add NRF51 entry
arm: Add Nordic Semiconductor nRF51 SoC
arm: Add BBC micro:bit machine

 MAINTAINERS                     |   8 ++
 default-configs/arm-softmmu.mak |   1 +
 hw/arm/Makefile.objs            |   1 +
 hw/arm/microbit.c               |  67 ++++++++++++++++
 hw/arm/nrf51_soc.c              | 130 ++++++++++++++++++++++++++++++++
 include/hw/arm/nrf51_soc.h      |  41 ++++++++++
 6 files changed, 248 insertions(+)
 create mode 100644 hw/arm/microbit.c
 create mode 100644 hw/arm/nrf51_soc.c
 create mode 100644 include/hw/arm/nrf51_soc.h
Signature · 1 line
2.17.1
#1 lore raw

PATCH v6 1/3 MAINTAINERS: Add NRF51 entry

This contains the NRF51, and the machine that uses it, the BBC micro:bit.

---
v3:
fix spelling of mailing list
add stefan's reviewed-by
v6:
Add Peter's reviewed-by

---
 MAINTAINERS | 8 ++++++++
 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
index d12518c08f10..d30f23f127ba 100644
@@ -670,6 +670,14 @@ F: include/hw/*/*aspeed*
 F: hw/net/ftgmac100.c
 F: include/hw/net/ftgmac100.h
 
+NRF51
+M: Joel Stanley <[email protected]>
+L: [email protected]
+S: Maintained
+F: hw/arm/nrf51_soc.c
+F: hw/arm/microbit.c
+F: include/hw/arm/nrf51_soc.h
+
 CRIS Machines
 -------------
 Axis Dev88
Signature · 1 line
2.17.1
#2 lore raw

PATCH v6 2/3 arm: Add Nordic Semiconductor nRF51 SoC

In reply to Joel Stanley

The nRF51 is a Cortex-M0 microcontroller with an on-board radio module, plus other common ARM SoC peripherals.

http://infocenter.nordicsemi.com/pdf/nRF51_RM_v3.0.pdf

This defines a basic model of the CPU and memory, with no peripherals implemented at this stage.

---
v2:
- put memory as struct fileds in state structure
- pass OBJECT(s) as owner, not NULL
- Add missing addresses for ficr
- Fix flash and sram sizes for microbit
- Embed cpu object in state object an initalise it without use of armv7m_init
- Link to datasheet
v3:
- rebase nrf51 on m0 changes
- remove unused kernel_filename
- clarify flash and sram size
- make flash and sram size properties of the soc state
v4:
- set the number of interrupts to 32
v5:
- move back to armv7m calls, as v4 of Stefan's patch removed the m_profile changes
v6:
- Split comment open and closing to it's own line
- Check err after every call
- Change flash _init_ram + _set_readonly to _init_rom
- Add defines for 'private' region
- Use sysbus_init_child_obj instead of _initalise, _property_add_child, _set_parent_bus
- remove osdep.h include from header

---
 default-configs/arm-softmmu.mak |   1 +
 hw/arm/Makefile.objs            |   1 +
 hw/arm/nrf51_soc.c              | 130 ++++++++++++++++++++++++++++++++
 include/hw/arm/nrf51_soc.h      |  41 ++++++++++
 4 files changed, 173 insertions(+)
 create mode 100644 hw/arm/nrf51_soc.c
 create mode 100644 include/hw/arm/nrf51_soc.h
default-configs/arm-softmmu.mak +1 -0
index 0483d548d96a..2420491aacd4 100644
@@ -101,6 +101,7 @@ CONFIG_STM32F2XX_SYSCFG=y
 CONFIG_STM32F2XX_ADC=y
 CONFIG_STM32F2XX_SPI=y
 CONFIG_STM32F205_SOC=y
+CONFIG_NRF51_SOC=y
 
 CONFIG_CMSDK_APB_TIMER=y
 CONFIG_CMSDK_APB_DUALTIMER=y
hw/arm/Makefile.objs +1 -0
index 2902f47b4c4c..ae4e20373b9e 100644
@@ -37,3 +37,4 @@ obj-$(CONFIG_IOTKIT) += iotkit.o
 obj-$(CONFIG_FSL_IMX7) += fsl-imx7.o mcimx7d-sabre.o
 obj-$(CONFIG_ARM_SMMUV3) += smmu-common.o smmuv3.o
 obj-$(CONFIG_FSL_IMX6UL) += fsl-imx6ul.o mcimx6ul-evk.o
+obj-$(CONFIG_NRF51_SOC) += nrf51_soc.o
hw/arm/nrf51_soc.c new file +130 -0

130 lines not on this page · raw message

include/hw/arm/nrf51_soc.h new file +41 -0

41 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

PATCH v6 3/3 arm: Add BBC micro:bit machine

In reply to Joel Stanley

This adds the base for a machine model of the BBC micro:bit:

https://en.wikipedia.org/wiki/Micro_Bit

This is a system with a nRF51 SoC containing the main processor, with various peripherals on board.

---
v2:
- Instead of setting kernel filename property, load the image directly
- Add link to hardware overview website
v3:
- Rebase microbit on m0 changes
- Remove hard-coded flash size and retrieve from the soc
- Add Stefan's reviewed-by
v5:
- move back to armv7m calls, as v4 of Stefan's patch removed the m_profile changes
v6:
- MICROBITMachineState -> MicrobitMachineState
- Rework machine type init with PMM's suggestions

---
 hw/arm/Makefile.objs |  2 +-
 hw/arm/microbit.c    | 67 ++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletion(-)
 create mode 100644 hw/arm/microbit.c
hw/arm/Makefile.objs +1 -1
index ae4e20373b9e..5f88062c666d 100644
@@ -37,4 +37,4 @@ obj-$(CONFIG_IOTKIT) += iotkit.o
 obj-$(CONFIG_FSL_IMX7) += fsl-imx7.o mcimx7d-sabre.o
 obj-$(CONFIG_ARM_SMMUV3) += smmu-common.o smmuv3.o
 obj-$(CONFIG_FSL_IMX6UL) += fsl-imx6ul.o mcimx6ul-evk.o
-obj-$(CONFIG_NRF51_SOC) += nrf51_soc.o
+obj-$(CONFIG_NRF51_SOC) += nrf51_soc.o microbit.o
hw/arm/microbit.c new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
2.17.1
#4 lore raw
In reply to Joel Stanley
Quoted 6 lines · Joel Stanley

v6: Rework based on Peter's review
v5: Change back to ARMv7M from ARMMProfile
v4: Fix number of IRQs
v3: Rebase on Stefan's cortex-m0 series
v2: Addresses review from Peter and Stefan

Quoted 8 lines

This short series implements a minimal definition of the Nordic Semiconductor nRF51, a Cortex-M0 ARM SoC, and the BBC micro:bit, a machine that will use this SoC.

Joel Stanley (3):
MAINTAINERS: Add NRF51 entry
arm: Add Nordic Semiconductor nRF51 SoC
arm: Add BBC micro:bit machine

Applied to target-arm.next, thanks.

-- PMM

#5 lore raw

Great news!
I will respin my patch series with the peripherals!

Cheers,
Steffen

Quoted 20 lines · Peter Maydell
Quoted 6 lines · Joel Stanley

v6: Rework based on Peter's review
v5: Change back to ARMv7M from ARMMProfile
v4: Fix number of IRQs
v3: Rebase on Stefan's cortex-m0 series
v2: Addresses review from Peter and Stefan

Quoted 8 lines

This short series implements a minimal definition of the Nordic Semiconductor nRF51, a Cortex-M0 ARM SoC, and the BBC micro:bit, a machine that will use this SoC.

Joel Stanley (3):
MAINTAINERS: Add NRF51 entry
arm: Add Nordic Semiconductor nRF51 SoC
arm: Add BBC micro:bit machine

Applied to target-arm.next, thanks.

-- PMM