drivers: entropy: replace CONFIG_ENTROPY_NAME with DT macro

Replace CONFIG_ENTROPY_NAME with DT_CHOSEN_ZEPHYR_ENTROPY_LABEL.  We now
set zephyr,entropy in the chosen node of the device tree to the entropy
device.

This allows us to remove CONFIG_ENTROPY_NAME from dts_fixup.h.  Also
remove any other stale ENTROPY related defines in dts_fixup.h files.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-04-06 09:59:03 -05:00 committed by Kumar Gala
commit 43a7d26603
61 changed files with 131 additions and 92 deletions

View file

@ -6,4 +6,3 @@
#define DT_FLASH_DEV_NAME DT_LABEL(DT_INST(0, zephyr_sim_flash)) #define DT_FLASH_DEV_NAME DT_LABEL(DT_INST(0, zephyr_sim_flash))
#define DT_UART_0_DEV_NAME DT_ZEPHYR_NATIVE_POSIX_UART_UART_LABEL #define DT_UART_0_DEV_NAME DT_ZEPHYR_NATIVE_POSIX_UART_UART_LABEL
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, zephyr_native_posix_rng))

View file

@ -16,6 +16,7 @@
zephyr,shell-uart = &uart0; zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0; zephyr,uart-mcumgr = &uart0;
zephyr,flash = &flash0; zephyr,flash = &flash0;
zephyr,entropy = &rng;
}; };
aliases { aliases {
@ -85,7 +86,7 @@
current-speed = <0>; current-speed = <0>;
}; };
rng { rng: rng {
status = "okay"; status = "okay";
compatible = "zephyr,native-posix-rng"; compatible = "zephyr,native-posix-rng";
label = "ENTROPY_0"; label = "ENTROPY_0";

View file

@ -1,8 +0,0 @@
/* Copyright (c) 2020 Nordic Semiconductor ASA */
/* SPDX-License-Identifier: Apache-2.0 */
/* Board level DTS fixup file */
#ifndef CONFIG_ENTROPY_NAME
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, nordic_nrf_rng))
#endif

View file

@ -49,6 +49,10 @@
tc-6 = &tc6; tc-6 = &tc6;
}; };
chosen {
zephyr,entropy = &trng;
};
soc { soc {
sram0: memory@20000000 { sram0: memory@20000000 {
compatible = "mmio-sram"; compatible = "mmio-sram";

View file

@ -14,6 +14,10 @@
watchdog0 = &wdt; watchdog0 = &wdt;
}; };
chosen {
zephyr,entropy = &trng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -6,6 +6,10 @@
#include "nrf5_common.dtsi" #include "nrf5_common.dtsi"
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -6,6 +6,10 @@
#include "nrf5_common.dtsi" #include "nrf5_common.dtsi"
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -9,6 +9,10 @@
#include "nrf5_common.dtsi" #include "nrf5_common.dtsi"
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -6,6 +6,10 @@
#include "nrf5_common.dtsi" #include "nrf5_common.dtsi"
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -10,6 +10,10 @@
#include "nrf5_common.dtsi" #include "nrf5_common.dtsi"
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -6,6 +6,10 @@
#include "nrf5_common.dtsi" #include "nrf5_common.dtsi"
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -9,6 +9,10 @@
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -11,6 +11,9 @@
#include <dt-bindings/i2c/i2c.h> #include <dt-bindings/i2c/i2c.h>
/ { / {
chosen {
zephyr,entropy = &rnga;
};
aliases { aliases {
adc-0 = &adc0; adc-0 = &adc0;

View file

@ -7,7 +7,6 @@
#include <dt-bindings/i2c/i2c.h> #include <dt-bindings/i2c/i2c.h>
/ { / {
aliases { aliases {
adc-0 = &adc0; adc-0 = &adc0;
adc-1 = &adc1; adc-1 = &adc1;
@ -43,6 +42,10 @@
watchdog0 = &wdog; watchdog0 = &wdog;
}; };
chosen {
zephyr,entropy = &rnga;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -43,6 +43,10 @@
watchdog0 = &wdog; watchdog0 = &wdog;
}; };
chosen {
zephyr,entropy = &trng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -33,6 +33,10 @@
watchdog0 = &wdog; watchdog0 = &wdog;
}; };
chosen {
zephyr,entropy = &rnga;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -24,6 +24,10 @@
uart-0 = &lpuart0; uart-0 = &lpuart0;
}; };
chosen {
zephyr,entropy = &trng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -24,6 +24,10 @@
uart-0 = &lpuart0; uart-0 = &lpuart0;
}; };
chosen {
zephyr,entropy = &trng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -37,6 +37,10 @@
usbd-2 = &usbd2; usbd-2 = &usbd2;
}; };
chosen {
zephyr,entropy = &trng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -11,6 +11,10 @@
#include "gpio_gecko.h" #include "gpio_gecko.h"
/ { / {
chosen {
zephyr,entropy = &trng0;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -6,6 +6,10 @@
#include "gpio_gecko.h" #include "gpio_gecko.h"
/ { / {
chosen {
zephyr,entropy = &trng0;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -7,6 +7,10 @@
#include <st/f4/stm32f401.dtsi> #include <st/f4/stm32f401.dtsi>
/ { / {
chosen {
zephyr,entropy = &rng;
};
soc { soc {
pinctrl: pin-controller@40020000 { pinctrl: pin-controller@40020000 {
reg = <0x40020000 0x2400>; reg = <0x40020000 0x2400>;

View file

@ -7,6 +7,10 @@
#include <st/f4/stm32f411.dtsi> #include <st/f4/stm32f411.dtsi>
/ { / {
chosen {
zephyr,entropy = &rng;
};
soc { soc {
pinctrl: pin-controller@40020000 { pinctrl: pin-controller@40020000 {
reg = <0x40020000 0x1c00>; reg = <0x40020000 0x1c00>;

View file

@ -11,6 +11,10 @@
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -11,6 +11,10 @@
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -12,6 +12,10 @@
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
chosen {
zephyr,entropy = &rng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -9,6 +9,10 @@
#include <dt-bindings/gpio/gpio.h> #include <dt-bindings/gpio/gpio.h>
/ { / {
chosen {
zephyr,entropy = &trng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -9,6 +9,12 @@
#size-cells = <1>; #size-cells = <1>;
compatible = "litex,vexriscv", "litex-dev"; compatible = "litex,vexriscv", "litex-dev";
model = "litex,vexriscv"; model = "litex,vexriscv";
chosen {
zephyr,entropy = &prbs0;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -42,6 +42,10 @@
pwm-3 = &tpm3; pwm-3 = &tpm3;
}; };
chosen {
zephyr,entropy = &trng;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -8,6 +8,10 @@
#include <dt-bindings/i2c/i2c.h> #include <dt-bindings/i2c/i2c.h>
/ { / {
chosen {
zephyr,entropy = &trng0;
};
cpus { cpus {
#address-cells = <1>; #address-cells = <1>;
#size-cells = <0>; #size-cells = <0>;

View file

@ -388,7 +388,7 @@ void z_early_boot_rand_get(u8_t *buf, size_t length)
{ {
int n = sizeof(u32_t); int n = sizeof(u32_t);
#ifdef CONFIG_ENTROPY_HAS_DRIVER #ifdef CONFIG_ENTROPY_HAS_DRIVER
struct device *entropy = device_get_binding(CONFIG_ENTROPY_NAME); struct device *entropy = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
int rc; int rc;
if (entropy == NULL) { if (entropy == NULL) {

View file

@ -14,7 +14,7 @@ void main(void)
printf("Entropy Example! %s\n", CONFIG_ARCH); printf("Entropy Example! %s\n", CONFIG_ARCH);
dev = device_get_binding(CONFIG_ENTROPY_NAME); dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
if (!dev) { if (!dev) {
printf("error: no entropy device\n"); printf("error: no entropy device\n");
return; return;

View file

@ -124,8 +124,6 @@
#define DT_USBHS_PERIPHERAL_ID DT_ATMEL_SAM_USBHS_40038000_PERIPHERAL_ID #define DT_USBHS_PERIPHERAL_ID DT_ATMEL_SAM_USBHS_40038000_PERIPHERAL_ID
#define DT_USBHS_RAM_BASE_ADDRESS DT_ATMEL_SAM_USBHS_40038000_RAM_0 #define DT_USBHS_RAM_BASE_ADDRESS DT_ATMEL_SAM_USBHS_40038000_RAM_0
#define CONFIG_ENTROPY_NAME DT_ATMEL_SAM_TRNG_40070000_LABEL
#define DT_FLASH_DEV_BASE_ADDRESS DT_ATMEL_SAM_FLASH_CONTROLLER_400E0C00_BASE_ADDRESS #define DT_FLASH_DEV_BASE_ADDRESS DT_ATMEL_SAM_FLASH_CONTROLLER_400E0C00_BASE_ADDRESS
#define DT_FLASH_DEV_NAME DT_ATMEL_SAM_FLASH_CONTROLLER_400E0C00_LABEL #define DT_FLASH_DEV_NAME DT_ATMEL_SAM_FLASH_CONTROLLER_400E0C00_LABEL

View file

@ -129,8 +129,6 @@
#define DT_USBHS_PERIPHERAL_ID DT_ATMEL_SAM_USBHS_40038000_PERIPHERAL_ID #define DT_USBHS_PERIPHERAL_ID DT_ATMEL_SAM_USBHS_40038000_PERIPHERAL_ID
#define DT_USBHS_RAM_BASE_ADDRESS DT_ATMEL_SAM_USBHS_40038000_RAM_0 #define DT_USBHS_RAM_BASE_ADDRESS DT_ATMEL_SAM_USBHS_40038000_RAM_0
#define CONFIG_ENTROPY_NAME DT_ATMEL_SAM_TRNG_40070000_LABEL
#define DT_FLASH_DEV_BASE_ADDRESS DT_ATMEL_SAM_FLASH_CONTROLLER_400E0C00_BASE_ADDRESS #define DT_FLASH_DEV_BASE_ADDRESS DT_ATMEL_SAM_FLASH_CONTROLLER_400E0C00_BASE_ADDRESS
#define DT_FLASH_DEV_NAME DT_ATMEL_SAM_FLASH_CONTROLLER_400E0C00_LABEL #define DT_FLASH_DEV_NAME DT_ATMEL_SAM_FLASH_CONTROLLER_400E0C00_LABEL

View file

@ -2,10 +2,6 @@
/* SoC level DTS fixup file */ /* SoC level DTS fixup file */
#ifndef CONFIG_ENTROPY_NAME
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, nordic_nrf_rng))
#endif
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS #define DT_NUM_IRQ_PRIO_BITS DT_ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define DT_ADC_0_NAME DT_NORDIC_NRF_ADC_ADC_0_LABEL #define DT_ADC_0_NAME DT_NORDIC_NRF_ADC_ADC_0_LABEL

View file

@ -2,10 +2,6 @@
/* SoC level DTS fixup file */ /* SoC level DTS fixup file */
#ifndef CONFIG_ENTROPY_NAME
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, nordic_nrf_rng))
#endif
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS #define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define DT_ADC_0_NAME DT_NORDIC_NRF_SAADC_ADC_0_LABEL #define DT_ADC_0_NAME DT_NORDIC_NRF_SAADC_ADC_0_LABEL

View file

@ -6,10 +6,6 @@
/* SoC level DTS fixup file */ /* SoC level DTS fixup file */
#ifndef CONFIG_ENTROPY_NAME
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, nordic_nrf_rng))
#endif
#define DT_NUM_IRQ_PRIO_BITS \ #define DT_NUM_IRQ_PRIO_BITS \
DT_ARM_V8M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS DT_ARM_V8M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS

View file

@ -25,8 +25,6 @@
#define DT_IRQ_ETH1_COMMON DT_NXP_KINETIS_ETHERNET_402D4000_IRQ_0 #define DT_IRQ_ETH1_COMMON DT_NXP_KINETIS_ETHERNET_402D4000_IRQ_0
#define DT_IRQ_ETH1_IEEE1588_TMR DT_NXP_KINETIS_PTP_402D4000_PTP_IRQ_0 #define DT_IRQ_ETH1_IEEE1588_TMR DT_NXP_KINETIS_PTP_402D4000_PTP_IRQ_0
#define CONFIG_ENTROPY_NAME DT_NXP_KINETIS_TRNG_400CC000_LABEL
#define DT_USBD_MCUX_EHCI_NAME DT_NXP_KINETIS_USBD_402E0000_LABEL #define DT_USBD_MCUX_EHCI_NAME DT_NXP_KINETIS_USBD_402E0000_LABEL
#define DT_USBD_MCUX_EHCI_IRQ DT_NXP_KINETIS_USBD_402E0000_IRQ_USB_OTG #define DT_USBD_MCUX_EHCI_IRQ DT_NXP_KINETIS_USBD_402E0000_IRQ_USB_OTG
#define DT_USBD_MCUX_EHCI_IRQ_PRI DT_NXP_KINETIS_USBD_402E0000_IRQ_0_PRIORITY #define DT_USBD_MCUX_EHCI_IRQ_PRI DT_NXP_KINETIS_USBD_402E0000_IRQ_0_PRIORITY

View file

@ -21,10 +21,4 @@
#define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS #define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS
#define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS #define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS
#define DT_ENTROPY_MCUX_RNGA_BASE_ADDRESS DT_NXP_KINETIS_RNGA_40029000_BASE_ADDRESS
#define DT_ENTROPY_MCUX_RNGA_IRQ DT_NXP_KINETIS_RNGA_40029000_IRQ_0
#define DT_ENTROPY_MCUX_RNGA_IRQ_PRI DT_NXP_KINETIS_RNGA_40029000_IRQ_0_PRIORITY
#define DT_ENTROPY_MCUX_RNGA_NAME DT_NXP_KINETIS_RNGA_40029000_LABEL
#define CONFIG_ENTROPY_NAME DT_NXP_KINETIS_RNGA_40029000_LABEL
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -35,12 +35,6 @@
#define DT_IRQ_ETH_ERR_MISC DT_NXP_KINETIS_ETHERNET_400C0004_IRQ_ERR_MISC #define DT_IRQ_ETH_ERR_MISC DT_NXP_KINETIS_ETHERNET_400C0004_IRQ_ERR_MISC
#define DT_ETH_MCUX_0_IRQ_PRI DT_NXP_KINETIS_ETHERNET_400C0004_IRQ_RX_PRIORITY #define DT_ETH_MCUX_0_IRQ_PRI DT_NXP_KINETIS_ETHERNET_400C0004_IRQ_RX_PRIORITY
#define DT_ENTROPY_MCUX_RNGA_BASE_ADDRESS DT_NXP_KINETIS_RNGA_40029000_BASE_ADDRESS
#define DT_ENTROPY_MCUX_RNGA_IRQ DT_NXP_KINETIS_RNGA_40029000_IRQ_0
#define DT_ENTROPY_MCUX_RNGA_IRQ_PRI DT_NXP_KINETIS_RNGA_40029000_IRQ_0_PRIORITY
#define DT_ENTROPY_MCUX_RNGA_NAME DT_NXP_KINETIS_RNGA_40029000_LABEL
#define CONFIG_ENTROPY_NAME DT_NXP_KINETIS_RNGA_40029000_LABEL
#define DT_CAN_0_NAME DT_NXP_KINETIS_FLEXCAN_40024000_LABEL #define DT_CAN_0_NAME DT_NXP_KINETIS_FLEXCAN_40024000_LABEL
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -15,8 +15,6 @@
#define DT_ADC_0_IRQ_PRI DT_NXP_KINETIS_ADC16_4003B000_IRQ_0_PRIORITY #define DT_ADC_0_IRQ_PRI DT_NXP_KINETIS_ADC16_4003B000_IRQ_0_PRIORITY
#define DT_ADC_0_NAME DT_NXP_KINETIS_ADC16_4003B000_LABEL #define DT_ADC_0_NAME DT_NXP_KINETIS_ADC16_4003B000_LABEL
#define CONFIG_ENTROPY_NAME DT_NXP_KINETIS_TRNG_400A0000_LABEL
#define DT_RTC_0_NAME DT_LABEL(DT_INST(0, nxp_kinetis_rtc)) #define DT_RTC_0_NAME DT_LABEL(DT_INST(0, nxp_kinetis_rtc))
#define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL #define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL

View file

@ -21,11 +21,6 @@
#define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS #define DT_USBD_KINETIS_BASE_ADDRESS DT_NXP_KINETIS_USBD_40072000_BASE_ADDRESS
#define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS #define DT_USBD_KINETIS_NUM_BIDIR_EP DT_NXP_KINETIS_USBD_40072000_NUM_BIDIR_ENDPOINTS
#define DT_ENTROPY_MCUX_RNGA_BASE_ADDRESS DT_NXP_KINETIS_RNGA_40029000_BASE_ADDRESS
#define DT_ENTROPY_MCUX_RNGA_IRQ DT_NXP_KINETIS_RNGA_40029000_IRQ_0
#define DT_ENTROPY_MCUX_RNGA_IRQ_PRI DT_NXP_KINETIS_RNGA_40029000_IRQ_0_PRIORITY
#define DT_ENTROPY_MCUX_RNGA_NAME DT_NXP_KINETIS_RNGA_40029000_LABEL
#define CONFIG_ENTROPY_NAME DT_NXP_KINETIS_RNGA_40029000_LABEL
#endif /* CONFIG_SOC_MKW22D5 || CONFIG_SOC_MKW24D5 */ #endif /* CONFIG_SOC_MKW22D5 || CONFIG_SOC_MKW24D5 */
#if defined(CONFIG_SOC_MKW40Z4) || defined(CONFIG_SOC_MKW41Z4) #if defined(CONFIG_SOC_MKW40Z4) || defined(CONFIG_SOC_MKW41Z4)
@ -34,7 +29,5 @@
#define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFA_40020000_BASE_ADDRESS #define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFA_40020000_BASE_ADDRESS
#define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFA_40020000_LABEL #define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFA_40020000_LABEL
#define CONFIG_ENTROPY_NAME DT_NXP_KINETIS_TRNG_40029000_LABEL
#endif /* CONFIG_SOC_MKW40Z4 || CONFIG_SOC_MKW41Z4 */ #endif /* CONFIG_SOC_MKW40Z4 || CONFIG_SOC_MKW41Z4 */
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -16,6 +16,5 @@
#define DT_WDT_0_NAME DT_LABEL(DT_INST(0, silabs_gecko_wdog)) #define DT_WDT_0_NAME DT_LABEL(DT_INST(0, silabs_gecko_wdog))
#define DT_WDT_1_NAME DT_LABEL(DT_INST(1, silabs_gecko_wdog)) #define DT_WDT_1_NAME DT_LABEL(DT_INST(1, silabs_gecko_wdog))
#define CONFIG_ENTROPY_NAME DT_SILABS_GECKO_TRNG_4001D000_LABEL
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -16,6 +16,5 @@
#define DT_WDT_0_NAME DT_LABEL(DT_INST(0, silabs_gecko_wdog)) #define DT_WDT_0_NAME DT_LABEL(DT_INST(0, silabs_gecko_wdog))
#define DT_WDT_1_NAME DT_LABEL(DT_INST(1, silabs_gecko_wdog)) #define DT_WDT_1_NAME DT_LABEL(DT_INST(1, silabs_gecko_wdog))
#define CONFIG_ENTROPY_NAME DT_SILABS_GECKO_TRNG_4001D000_LABEL
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -18,6 +18,5 @@
#define DT_WDT_0_NAME DT_LABEL(DT_INST(0, silabs_gecko_wdog)) #define DT_WDT_0_NAME DT_LABEL(DT_INST(0, silabs_gecko_wdog))
#define DT_WDT_1_NAME DT_LABEL(DT_INST(1, silabs_gecko_wdog)) #define DT_WDT_1_NAME DT_LABEL(DT_INST(1, silabs_gecko_wdog))
#define CONFIG_ENTROPY_NAME DT_SILABS_GECKO_TRNG_4001D000_LABEL
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -207,8 +207,4 @@
#define DT_FLASH_DEV_NAME DT_LABEL(DT_INST(0, st_stm32f4_flash_controller)) #define DT_FLASH_DEV_NAME DT_LABEL(DT_INST(0, st_stm32f4_flash_controller))
#ifndef CONFIG_ENTROPY_NAME
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, st_stm32_rng))
#endif
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -65,8 +65,4 @@
#define DT_ADC_1_NAME DT_ST_STM32_ADC_40012000_LABEL #define DT_ADC_1_NAME DT_ST_STM32_ADC_40012000_LABEL
#ifndef CONFIG_ENTROPY_NAME
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, st_stm32_rng))
#endif
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -41,8 +41,4 @@
#define DT_WDT_0_NAME DT_LABEL(DT_INST(0, st_stm32_watchdog)) #define DT_WDT_0_NAME DT_LABEL(DT_INST(0, st_stm32_watchdog))
#ifndef CONFIG_ENTROPY_NAME
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, st_stm32_rng))
#endif
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -70,8 +70,4 @@
#define DT_LPTIM_1_CLOCK_BITS DT_ST_STM32_TIMERS_40007C00_CLOCK_BITS_0 #define DT_LPTIM_1_CLOCK_BITS DT_ST_STM32_TIMERS_40007C00_CLOCK_BITS_0
#define DT_LPTIM_1_CLOCK_BUS DT_ST_STM32_TIMERS_40007C00_CLOCK_BUS_0 #define DT_LPTIM_1_CLOCK_BUS DT_ST_STM32_TIMERS_40007C00_CLOCK_BUS_0
#ifndef CONFIG_ENTROPY_NAME
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, st_stm32_rng))
#endif
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -7,7 +7,6 @@
/* SoC level DTS fixup file */ /* SoC level DTS fixup file */
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS #define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, ti_cc13xx_cc26xx_trng))
#define DT_CPU_CLOCK_FREQUENCY DT_ARM_CORTEX_M4_0_CLOCK_FREQUENCY #define DT_CPU_CLOCK_FREQUENCY DT_ARM_CORTEX_M4_0_CLOCK_FREQUENCY

View file

@ -11,7 +11,6 @@
#define DT_FLASH_DEV_BASE_ADDRESS DT_OPENISA_RV32M1_FTFE_40023000_BASE_ADDRESS #define DT_FLASH_DEV_BASE_ADDRESS DT_OPENISA_RV32M1_FTFE_40023000_BASE_ADDRESS
#define DT_FLASH_DEV_NAME DT_OPENISA_RV32M1_FTFE_40023000_LABEL #define DT_FLASH_DEV_NAME DT_OPENISA_RV32M1_FTFE_40023000_LABEL
#define DT_START_UP_ENTRY_OFFSET 0x80 #define DT_START_UP_ENTRY_OFFSET 0x80
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, openisa_rv32m1_trng))
#endif /* CONFIG_SOC_OPENISA_RV32M1_RISCV32 */ #endif /* CONFIG_SOC_OPENISA_RV32M1_RISCV32 */

View file

@ -7,6 +7,5 @@
/* SoC level DTS fixup file */ /* SoC level DTS fixup file */
#define DT_CPU_CLOCK_FREQUENCY DT_CADENCE_TENSILICA_XTENSA_LX6_0_CLOCK_FREQUENCY #define DT_CPU_CLOCK_FREQUENCY DT_CADENCE_TENSILICA_XTENSA_LX6_0_CLOCK_FREQUENCY
#define CONFIG_ENTROPY_NAME DT_LABEL(DT_INST(0, espressif_esp32_trng))
#define DT_WDT_0_NAME DT_LABEL(DT_INST(0, espressif_esp32_watchdog)) #define DT_WDT_0_NAME DT_LABEL(DT_INST(0, espressif_esp32_watchdog))
/* End of SoC Level DTS fixup file */ /* End of SoC Level DTS fixup file */

View file

@ -132,7 +132,7 @@ int ll_init(struct k_sem *sem_rx)
clock_control_on(clk, CLOCK_CONTROL_NRF_SUBSYS_LF); clock_control_on(clk, CLOCK_CONTROL_NRF_SUBSYS_LF);
entropy = device_get_binding(CONFIG_ENTROPY_NAME); entropy = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
if (!entropy) { if (!entropy) {
return -ENODEV; return -ENODEV;
} }

View file

@ -606,7 +606,7 @@ int ull_conn_init(void)
{ {
int err; int err;
entropy = device_get_binding(CONFIG_ENTROPY_NAME); entropy = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
if (!entropy) { if (!entropy) {
return -ENODEV; return -ENODEV;
} }

View file

@ -46,11 +46,11 @@ int util_rand(void *buf, size_t len)
/* Only one entropy device exists, so this is safe even /* Only one entropy device exists, so this is safe even
* if the whole operation isn't atomic. * if the whole operation isn't atomic.
*/ */
dev = device_get_binding(CONFIG_ENTROPY_NAME); dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
__ASSERT((dev != NULL), __ASSERT((dev != NULL),
"Device driver for %s (CONFIG_ENTROPY_NAME) not found. " "Device driver for %s (DT_CHOSEN_ZEPHYR_ENTROPY_LABEL) not found. "
"Check your build configuration!", "Check your build configuration!",
CONFIG_ENTROPY_NAME); DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
} }
return entropy_get_entropy(dev, (u8_t *)buf, len); return entropy_get_entropy(dev, (u8_t *)buf, len);

View file

@ -30,7 +30,7 @@ otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength)
} }
if (dev == NULL) { if (dev == NULL) {
dev = device_get_binding(CONFIG_ENTROPY_NAME); dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
if (dev == NULL) { if (dev == NULL) {
LOG_ERR("Failed to obtain entropy device"); LOG_ERR("Failed to obtain entropy device");
return OT_ERROR_FAILED; return OT_ERROR_FAILED;

View file

@ -260,7 +260,7 @@ static int tls_init(struct device *unused)
struct device *dev = NULL; struct device *dev = NULL;
#if defined(CONFIG_ENTROPY_HAS_DRIVER) #if defined(CONFIG_ENTROPY_HAS_DRIVER)
dev = device_get_binding(CONFIG_ENTROPY_NAME); dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
if (!dev) { if (!dev) {
NET_ERR("Failed to obtain entropy device"); NET_ERR("Failed to obtain entropy device");

View file

@ -54,12 +54,12 @@ static int ctr_drbg_initialize(void)
/* Only one entropy device exists, so this is safe even /* Only one entropy device exists, so this is safe even
* if the whole operation isn't atomic. * if the whole operation isn't atomic.
*/ */
entropy_driver = device_get_binding(CONFIG_ENTROPY_NAME); entropy_driver = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
if (!entropy_driver) { if (!entropy_driver) {
__ASSERT((entropy_driver != NULL), __ASSERT((entropy_driver != NULL),
"Device driver for %s (CONFIG_ENTROPY_NAME) not found. " "Device driver for %s (DT_CHOSEN_ZEPHYR_ENTROPY_LABEL) not found. "
"Check your build configuration!", "Check your build configuration!",
CONFIG_ENTROPY_NAME); DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
return -EINVAL; return -EINVAL;
} }

View file

@ -22,11 +22,11 @@ u32_t sys_rand32_get(void)
/* Only one entropy device exists, so this is safe even /* Only one entropy device exists, so this is safe even
* if the whole operation isn't atomic. * if the whole operation isn't atomic.
*/ */
dev = device_get_binding(CONFIG_ENTROPY_NAME); dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
__ASSERT((dev != NULL), __ASSERT((dev != NULL),
"Device driver for %s (CONFIG_ENTROPY_NAME) not found. " "Device driver for %s (DT_CHOSEN_ZEPHYR_ENTROPY_LABEL) not found. "
"Check your build configuration!", "Check your build configuration!",
CONFIG_ENTROPY_NAME); DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
entropy_driver = dev; entropy_driver = dev;
} }
@ -56,11 +56,11 @@ static int rand_get(u8_t *dst, size_t outlen, bool csrand)
/* Only one entropy device exists, so this is safe even /* Only one entropy device exists, so this is safe even
* if the whole operation isn't atomic. * if the whole operation isn't atomic.
*/ */
dev = device_get_binding(CONFIG_ENTROPY_NAME); dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
__ASSERT((dev != NULL), __ASSERT((dev != NULL),
"Device driver for %s (CONFIG_ENTROPY_NAME) not found. " "Device driver for %s (DT_CHOSEN_ZEPHYR_ENTROPY_LABEL) not found. "
"Check your build configuration!", "Check your build configuration!",
CONFIG_ENTROPY_NAME); DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
entropy_driver = dev; entropy_driver = dev;
} }

View file

@ -52,7 +52,7 @@ static inline u64_t rotl(const u64_t x, int k)
static int xoroshiro128_initialize(struct device *dev) static int xoroshiro128_initialize(struct device *dev)
{ {
dev = device_get_binding(CONFIG_ENTROPY_NAME); dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
if (!dev) { if (!dev) {
return -EINVAL; return -EINVAL;
} }

View file

@ -71,7 +71,7 @@ static int get_entropy(void)
u8_t buffer[BUFFER_LENGTH] = { 0 }; u8_t buffer[BUFFER_LENGTH] = { 0 };
int ret; int ret;
dev = device_get_binding(CONFIG_ENTROPY_NAME); dev = device_get_binding(DT_CHOSEN_ZEPHYR_ENTROPY_LABEL);
if (!dev) { if (!dev) {
TC_PRINT("error: no random device\n"); TC_PRINT("error: no random device\n");
return TC_FAIL; return TC_FAIL;