drivers: pfc_rcar: do MMIO mapping inside driver

Add MMIO mapping for PFC Renesas driver in order to avoid
mappings inside mmu_regions.c file.

Add a new system init function pfc_rcar_driver_init to PFC
Renesas driver for invoking a memory mapping macro.
Note: PFC Renesas driver doesn't use Zephyr Device Model.

Signed-off-by: Mykola Kvach <mykola_kvach@epam.com>
This commit is contained in:
Mykola Kvach 2023-03-14 23:22:36 +02:00 committed by Carles Cufí
parent cb9d1607b3
commit de639ed34c

View file

@ -12,8 +12,11 @@
#include <zephyr/drivers/pinctrl.h>
#include <soc.h>
#include <zephyr/sys/util.h>
#include <zephyr/sys/device_mmio.h>
#define PFC_REG_BASE DT_INST_REG_ADDR(0)
DEVICE_MMIO_TOPLEVEL_STATIC(pfc, DT_DRV_INST(0));
#define PFC_REG_BASE DEVICE_MMIO_TOPLEVEL_GET(pfc)
#define PFC_RCAR_PMMR 0x0
#define PFC_RCAR_GPSR 0x100
#define PFC_RCAR_IPSR 0x200
@ -214,3 +217,11 @@ int pinctrl_configure_pins(const pinctrl_soc_pin_t *pins, uint8_t pin_cnt,
return ret;
}
__boot_func static int pfc_rcar_driver_init(void)
{
DEVICE_MMIO_TOPLEVEL_MAP(pfc, K_MEM_CACHE_NONE);
return 0;
}
SYS_INIT(pfc_rcar_driver_init, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);