From 0781a4bed59bfecbb9a1f309e17c494cef26701b Mon Sep 17 00:00:00 2001 From: Daniel Baluta Date: Sat, 11 Jan 2020 19:38:37 +0200 Subject: [PATCH] rimage: Add support for imx8m This defines the iram/dram/sram memory zones and creates a new machine type for i.MX8M. Signed-off-by: Daniel Baluta --- rimage/file_simple.c | 31 +++++++++++++++++++++++++++++++ rimage/rimage.c | 1 + rimage/rimage.h | 2 ++ 3 files changed, 34 insertions(+) diff --git a/rimage/file_simple.c b/rimage/file_simple.c index fbd3dd65e..4391c4a72 100644 --- a/rimage/file_simple.c +++ b/rimage/file_simple.c @@ -40,6 +40,14 @@ #define IMX8_SRAM_BASE 0x92400000 #define IMX8_SRAM_SIZE 0x800000 +#define IMX8M_IRAM_BASE 0x3b6f8000 +#define IMX8M_IRAM_HOST_OFFSET 0x10000 +#define IMX8M_IRAM_SIZE 0x800 +#define IMX8M_DRAM_BASE 0x3b6f8000 +#define IMX8M_DRAM_SIZE 0x8000 +#define IMX8M_SRAM_BASE 0x92400000 +#define IMX8M_SRAM_SIZE 0x800000 + static int get_mem_zone_type(struct image *image, Elf32_Shdr *section) { const struct adsp *adsp = image->adsp; @@ -591,3 +599,26 @@ const struct adsp machine_imx8x = { .machine_id = MACHINE_IMX8X, .write_firmware = simple_write_firmware, }; + +const struct adsp machine_imx8m = { + .name = "imx8m", + .mem_zones = { + [SOF_FW_BLK_TYPE_IRAM] = { + .base = IMX8M_IRAM_BASE, + .size = IMX8M_IRAM_SIZE, + .host_offset = IMX8M_IRAM_HOST_OFFSET, + }, + [SOF_FW_BLK_TYPE_DRAM] = { + .base = IMX8M_DRAM_BASE, + .size = IMX8M_DRAM_SIZE, + .host_offset = 0, + }, + [SOF_FW_BLK_TYPE_SRAM] = { + .base = IMX8M_SRAM_BASE, + .size = IMX8M_SRAM_SIZE, + .host_offset = 0, + }, + }, + .machine_id = MACHINE_IMX8M, + .write_firmware = simple_write_firmware, +}; diff --git a/rimage/rimage.c b/rimage/rimage.c index 64982f0fb..8413c073d 100644 --- a/rimage/rimage.c +++ b/rimage/rimage.c @@ -28,6 +28,7 @@ static const struct adsp *machine[] = { &machine_skl, &machine_imx8, &machine_imx8x, + &machine_imx8m, }; static void usage(char *name) diff --git a/rimage/rimage.h b/rimage/rimage.h index 545e7be1e..fb6ce8beb 100644 --- a/rimage/rimage.h +++ b/rimage/rimage.h @@ -39,6 +39,7 @@ enum machine_id { MACHINE_SUECREEK, MACHINE_IMX8, MACHINE_IMX8X, + MACHINE_IMX8M, MACHINE_MAX }; @@ -195,5 +196,6 @@ extern const struct adsp machine_skl; extern const struct adsp machine_kbl; extern const struct adsp machine_imx8; extern const struct adsp machine_imx8x; +extern const struct adsp machine_imx8m; #endif