random: mcux: rename random_mcux to random_mcux_rnga

MCUX contains more than one type of random number generator,
so refrect this in config and file names.

Change-Id: Iba4482a1ae41f35d471686f8b159c113147c4df8
Signed-off-by: Bogdan Davidoaia <bogdan.davidoaia@linaro.org>
This commit is contained in:
Bogdan Davidoaia 2017-02-27 16:45:08 +02:00 committed by Kumar Gala
commit 50cb5a6bd3
5 changed files with 18 additions and 18 deletions

View file

@ -62,7 +62,7 @@ endif # NET_L2_ETHERNET
if RANDOM_GENERATOR
config RANDOM_MCUX
config RANDOM_MCUX_RNGA
def_bool y
endif # RANDOM_GENERATOR

View file

@ -4,8 +4,8 @@
#
# SPDX-License-Identifier: Apache-2.0
menuconfig RANDOM_MCUX
bool "MCUX Random driver"
menuconfig RANDOM_MCUX_RNGA
bool "MCUX RNGA driver"
depends on RANDOM_GENERATOR && HAS_RNGA
default n
select RANDOM_HAS_DRIVER

View file

@ -1,3 +1,3 @@
obj-$(CONFIG_RANDOM_MCUX) += random_mcux.o
obj-$(CONFIG_RANDOM_MCUX_RNGA) += random_mcux_rnga.o
obj-$(CONFIG_TIMER_RANDOM_GENERATOR) = rand32_timer.o
obj-$(CONFIG_X86_TSC_RANDOM_GENERATOR) += rand32_timestamp.o

View file

@ -11,7 +11,7 @@
#include "fsl_rnga.h"
static uint8_t random_mcux_get_uint8(void)
static uint8_t random_mcux_rnga_get_uint8(void)
{
uint32_t random;
uint8_t output = 0;
@ -36,7 +36,7 @@ static uint8_t random_mcux_get_uint8(void)
return output;
}
static int random_mcux_get_entropy(struct device *dev, uint8_t *buffer,
static int random_mcux_rnga_get_entropy(struct device *dev, uint8_t *buffer,
uint16_t length)
{
int i;
@ -44,24 +44,24 @@ static int random_mcux_get_entropy(struct device *dev, uint8_t *buffer,
ARG_UNUSED(dev);
for (i = 0; i < length; i++) {
buffer[i] = random_mcux_get_uint8();
buffer[i] = random_mcux_rnga_get_uint8();
}
return 0;
}
static const struct random_driver_api random_mcux_api_funcs = {
.get_entropy = random_mcux_get_entropy
static const struct random_driver_api random_mcux_rnga_api_funcs = {
.get_entropy = random_mcux_rnga_get_entropy
};
static int random_mcux_init(struct device *);
static int random_mcux_rnga_init(struct device *);
DEVICE_AND_API_INIT(random_mcux, CONFIG_RANDOM_NAME,
random_mcux_init, NULL, NULL,
DEVICE_AND_API_INIT(random_mcux_rnga, CONFIG_RANDOM_NAME,
random_mcux_rnga_init, NULL, NULL,
PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&random_mcux_api_funcs);
&random_mcux_rnga_api_funcs);
static int random_mcux_init(struct device *dev)
static int random_mcux_rnga_init(struct device *dev)
{
uint32_t seed = k_cycle_get_32();
@ -85,7 +85,7 @@ uint32_t sys_rand32_get(void)
uint32_t output;
int r;
r = random_mcux_get_entropy(DEVICE_GET(random_mcux),
r = random_mcux_rnga_get_entropy(DEVICE_GET(random_mcux_rnga),
(uint8_t *) &output, sizeof(output));
__ASSERT_NO_MSG(!r);

View file

@ -6,7 +6,7 @@
obj-$(CONFIG_ETH_MCUX) += fsl_enet.o
obj-$(CONFIG_I2C_MCUX) += fsl_i2c.o
obj-$(CONFIG_RANDOM_MCUX) += fsl_rnga.o
obj-$(CONFIG_RANDOM_MCUX_RNGA) += fsl_rnga.o
obj-$(CONFIG_SOC_FLASH_MCUX) += fsl_flash.o
obj-$(CONFIG_SPI_MCUX) += fsl_dspi.o
obj-$(CONFIG_UART_MCUX) += fsl_uart.o