From b0b241d81b471eec36da23beefa6867ba13df735 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 19 Oct 2020 15:08:12 +0200 Subject: [PATCH 1/2] Revert "soc/xtensa/intel_adsp: Remove GPIO metadata" Actually only the last two hunks of this commit have to be reverted, they are unrelated to GPIOs and they are needed for SOF. Reverting the complete commit for now until it is fixed. This reverts commit e4d93899b7d0ca3a5508ba42d258e43af5ef2a77. Signed-off-by: Guennadi Liakhovetski --- soc/xtensa/intel_adsp/common/adsp.c | 108 ++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/soc/xtensa/intel_adsp/common/adsp.c b/soc/xtensa/intel_adsp/common/adsp.c index 257e978ae7a0c..e866c9d697285 100644 --- a/soc/xtensa/intel_adsp/common/adsp.c +++ b/soc/xtensa/intel_adsp/common/adsp.c @@ -19,6 +19,112 @@ LOG_MODULE_REGISTER(sof); #include +/* TODO: Cleanup further */ + +#if CONFIG_DW_GPIO + +#include + +const struct gpio_pin_config gpio_data[] = { + { /* GPIO0 */ + .mux_id = 1, + .mux_config = {.bit = 0, .mask = 3, .fn = 1}, + }, { /* GPIO1 */ + .mux_id = 1, + .mux_config = {.bit = 2, .mask = 3, .fn = 1}, + }, { /* GPIO2 */ + .mux_id = 1, + .mux_config = {.bit = 4, .mask = 3, .fn = 1}, + }, { /* GPIO3 */ + .mux_id = 1, + .mux_config = {.bit = 6, .mask = 3, .fn = 1}, + }, { /* GPIO4 */ + .mux_id = 1, + .mux_config = {.bit = 8, .mask = 3, .fn = 1}, + }, { /* GPIO5 */ + .mux_id = 1, + .mux_config = {.bit = 10, .mask = 3, .fn = 1}, + }, { /* GPIO6 */ + .mux_id = 1, + .mux_config = {.bit = 12, .mask = 3, .fn = 1}, + }, { /* GPIO7 */ + .mux_id = 1, + .mux_config = {.bit = 14, .mask = 3, .fn = 1}, + }, { /* GPIO8 */ + .mux_id = 1, + .mux_config = {.bit = 16, .mask = 1, .fn = 1}, + }, { /* GPIO9 */ + .mux_id = 0, + .mux_config = {.bit = 11, .mask = 1, .fn = 1}, + }, { /* GPIO10 */ + .mux_id = 0, + .mux_config = {.bit = 11, .mask = 1, .fn = 1}, + }, { /* GPIO11 */ + .mux_id = 0, + .mux_config = {.bit = 11, .mask = 1, .fn = 1}, + }, { /* GPIO12 */ + .mux_id = 0, + .mux_config = {.bit = 11, .mask = 1, .fn = 1}, + }, { /* GPIO13 */ + .mux_id = 0, + .mux_config = {.bit = 0, .mask = 1, .fn = 1}, + }, { /* GPIO14 */ + .mux_id = 0, + .mux_config = {.bit = 1, .mask = 1, .fn = 1}, + }, { /* GPIO15 */ + .mux_id = 0, + .mux_config = {.bit = 9, .mask = 1, .fn = 1}, + }, { /* GPIO16 */ + .mux_id = 0, + .mux_config = {.bit = 9, .mask = 1, .fn = 1}, + }, { /* GPIO17 */ + .mux_id = 0, + .mux_config = {.bit = 9, .mask = 1, .fn = 1}, + }, { /* GPIO18 */ + .mux_id = 0, + .mux_config = {.bit = 9, .mask = 1, .fn = 1}, + }, { /* GPIO19 */ + .mux_id = 0, + .mux_config = {.bit = 10, .mask = 1, .fn = 1}, + }, { /* GPIO20 */ + .mux_id = 0, + .mux_config = {.bit = 10, .mask = 1, .fn = 1}, + }, { /* GPIO21 */ + .mux_id = 0, + .mux_config = {.bit = 10, .mask = 1, .fn = 1}, + }, { /* GPIO22 */ + .mux_id = 0, + .mux_config = {.bit = 10, .mask = 1, .fn = 1}, + }, { /* GPIO23 */ + .mux_id = 0, + .mux_config = {.bit = 16, .mask = 1, .fn = 1}, + }, { /* GPIO24 */ + .mux_id = 0, + .mux_config = {.bit = 16, .mask = 1, .fn = 1}, + }, { /* GPIO25 */ + .mux_id = 0, + .mux_config = {.bit = 26, .mask = 1, .fn = 1}, + }, +}; + +const int n_gpios = ARRAY_SIZE(gpio_data); + +#if CONFIG_INTEL_IOMUX + +#include + +struct iomux iomux_data[] = { + {.base = EXT_CTRL_BASE + 0x30,}, + {.base = EXT_CTRL_BASE + 0x34,}, + {.base = EXT_CTRL_BASE + 0x38,}, +}; + +const int n_iomux = ARRAY_SIZE(iomux_data); + +#endif + +#endif + #define SRAM_WINDOW_HOST_OFFSET(x) (0x80000 + x * 0x20000) static const struct adsp_ipc_fw_ready fw_ready_apl @@ -43,6 +149,7 @@ static const struct adsp_ipc_fw_ready fw_ready_apl .flags = 0, }; +#if !defined(CONFIG_SOF) #define NUM_WINDOWS 2 static const struct adsp_ipc_window sram_window = { @@ -134,3 +241,4 @@ static int adsp_init(const struct device *dev) /* Init after IPM initialization and before logging (uses memory windows) */ SYS_INIT(adsp_init, PRE_KERNEL_2, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); +#endif /* ! CONFIG_SOF */ From db42ff5874362b02550eaf7049da49810e547736 Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Mon, 19 Oct 2020 15:14:48 +0200 Subject: [PATCH 2/2] sof: add two Kconfig options to prj.conf SOF has to force aligned memory allocation and a single processor core execution for now. Signed-off-by: Guennadi Liakhovetski --- samples/audio/sof/prj.conf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/samples/audio/sof/prj.conf b/samples/audio/sof/prj.conf index 7419524862d1d..1b405524cb558 100644 --- a/samples/audio/sof/prj.conf +++ b/samples/audio/sof/prj.conf @@ -1,3 +1,5 @@ CONFIG_SOF=y CONFIG_SMP=n CONFIG_LOG=y +CONFIG_SYS_HEAP_ALIGNED_ALLOC=y +CONFIG_MP_NUM_CPUS=1