Skip to content

Enabling SOF Support For AMD Rembrandt platform - #5833

Merged
lgirdwood merged 5 commits into
thesofproject:mainfrom
balakishorepati:sof_push
Jun 15, 2022
Merged

lgirdwood merged 5 commits into
thesofproject:mainfrom
balakishorepati:sof_push

Conversation

@balakishorepati

Copy link
Copy Markdown
Contributor

This Patch Series will enable SOF based ACP(Audio Co Processor) firmware solution on Rembrandt platform.
Add rembrandt specific dai, dma and platform drivers.
Add BT,SP and HS driver instances for rembrandt platform.

Add rembrandt platform support to build fw image.
Add rembrandt_defconfig for rembrandt platform.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>

@marc-hb marc-hb left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is at least 90% copy/paste/diverge of "renoir". 3467 "rembrandt/" lines added with about 200 lines difference with renoir:

wc -l rembrandt/*
      16 rembrandt/CMakeLists.txt
      95 rembrandt/acp_bt_dai.c
     439 rembrandt/acp_bt_dma.c
     662 rembrandt/acp_dma.c
     147 rembrandt/acp_dmic_dai.c
     377 rembrandt/acp_dmic_dma.c
      96 rembrandt/acp_hs_dai.c
     407 rembrandt/acp_hs_dma.c
      95 rembrandt/acp_sp_dai.c
     407 rembrandt/acp_sp_dma.c
     420 rembrandt/interrupt.c
     205 rembrandt/ipc.c
     101 rembrandt/timer.c

    3467 total

rsync -a rembrandt/ renoir/

git diff -w -b --stat

 src/drivers/amd/renoir/CMakeLists.txt |  2 +
 src/drivers/amd/renoir/acp_bt_dai.c   |  3 +-
 src/drivers/amd/renoir/acp_bt_dma.c   | 68 +++++++++++++++---------------
 src/drivers/amd/renoir/acp_dma.c      | 78 ++++++++++++++++++++++++----------
 src/drivers/amd/renoir/acp_dmic_dai.c |  3 +-
 src/drivers/amd/renoir/acp_dmic_dma.c | 15 ++++---
 src/drivers/amd/renoir/acp_sp_dai.c   |  3 +-
 src/drivers/amd/renoir/acp_sp_dma.c   | 76 ++++++++++++++++-----------------
 src/drivers/amd/renoir/interrupt.c    | 79 +++++++++++++++++++++++++----------
 src/drivers/amd/renoir/ipc.c          | 42 ++++++-------------
 src/drivers/amd/renoir/timer.c        |  3 +-

 11 files changed, 209 insertions(+), 163 deletions(-)

src/platform/amd/rembrandt/ is at least 80% copy/paste/diverge.

Comment thread scripts/xtensa-build-all.sh Outdated

@marc-hb marc-hb May 19, 2022 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The docker container does not have the xtensa-rmb-elf toolchain yet, so this change will break ./scripts/docker-run.sh ./scripts/xtensa-build-all.sh -a for everyone and especially for people testing container updates.

Until you provide the new toolchain, add rmb to the next line instead:

SUPPORTED_PLATFORMS=( "${DEFAULT_PLATFORMS[@]}" rmb )

See comments here and similar discussion in #5388

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overlay and corresponding configs got up streamed and merged for rembrandt platform. So with above patch sets GCC build won't break.
Quoting the Pull requests for reference
thesofproject/crosstool-ng#16
thesofproject/xtensa-overlay#13

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now rmb still fails in https://github.com/thesofproject/sof/runs/6759196854 submitted 6 hours ago.

Please resolve comments when they are actually resolved, not when they "will be" resolved.

BTW

--- a/.github/workflows/pull-request.yml
+++ b/.github/workflows/pull-request.yml
@@ -114,7 +114,7 @@ jobs:
         # does not block all other builds.
         platform: [imx8ulp,
                    sue jsl tgl,
-                   rn,
+                   rn rmb,
                    mt8186 mt8195,
         ]

Comment thread src/drivers/amd/rembrandt/acp_bt_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_bt_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_bt_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_bt_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can use BIT(channel->index)

Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, don't understand. pdm_dma_enable is just a local variable. It won't change after the check in while(). I see this is copied from renoir, so possibly it's wrong there too.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@balakishorepati Isn't this structure being mapped to the HW and volatile (which would answer @lyakh question) ?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@balakishorepati ok, when the whole loop is seen it makes sense, but this part is already true as it's checked by the while() so the if(true) is not needed.

Comment thread src/drivers/amd/rembrandt/acp_dmic_dma.c Outdated
Comment thread src/drivers/CMakeLists.txt Outdated

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a general question to this PR: how different are these drivers from renoir? Could any be reused?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR uses different set of registers than Renoir. Currently we are not planning for restructure. We will plan for those activities once platforms are stabilized

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see below for comments, this loop seems strange

@balakishorepati balakishorepati May 31, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a safe check to avoid indefinite while loop if hw went to bad state and not returning expected status.
before entering to loop we read status register and wait for status to be succeeded. if hw is not return success then we wait for some specified time and return error.

 /* Check the PDM DMA Enable status bit */
 pdm_dma_enable = (acp_wov_pdm_dma_enable_t)
                        io_reg_read(PU_REGISTER_BASE + ACP_WOV_PDM_DMA_ENABLE);
                while (!(uint32_t)pdm_dma_enable.bits.pdm_dma_en_status) {
                        if (deadline < platform_timer_get(timer)) {
                                /* safe check in case we've got preempted after read */
                                if ((uint32_t)pdm_dma_enable.bits.pdm_dma_en_status)
                                        return 0;
                                tr_err(&acp_dmic_dma_tr, "DMICDMA: timed out for dma start");
                                return -ETIME;
                        }
                        pdm_dma_enable = (acp_wov_pdm_dma_enable_t)
                                        io_reg_read(PU_REGISTER_BASE + ACP_WOV_PDM_DMA_ENABLE);
                }

above is the complete code for loop.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 /* Check the PDM DMA Enable status bit */
 pdm_dma_enable = (acp_wov_pdm_dma_enable_t)
                        io_reg_read(PU_REGISTER_BASE + ACP_WOV_PDM_DMA_ENABLE);
                while (!(uint32_t)pdm_dma_enable.bits.pdm_dma_en_status) {

Answering my above comment - I see we are reading the HW here so the result is valid for the loop above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pdm_dma_enable variable is mapped to read PDM DMA register. So this variable will be updated based hw status

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's "mapped" to hw registers. It's a perfectly standard function-local object. You read hardware registers into it before the loop and at the bottom of the loop. Between while and this second if the object cannot change.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

superfluous parentheses

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to type cast to int as status is expecting it to be integer.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, a typecast has a lower precedence than ., so (int)x.y is fine

Comment thread src/drivers/amd/rembrandt/acp_hs_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_hs_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_hs_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_sp_dma.c Outdated
Comment thread src/platform/amd/rembrandt/lib/CMakeLists.txt Outdated

@marc-hb marc-hb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renoir and Rembrandt have different architecture. Currently we cannot share, but in future we will look at restructuring.

When diff -w -b shows 80-90% identical code it's pretty obvious a lot more code could be shared.

A frequent reason for copy/paste/diverge is the lack of validation resources to test refactored code on the older hardware. This lack never gets better.

PS: my "request changes" is only about not breaking scripts/xtensa-build-all.sh -a

@balakishorepati

Copy link
Copy Markdown
Contributor Author

Renoir and Rembrandt have different architecture. Currently we cannot share, but in future we will look at restructuring.

When diff -w -b shows 80-90% identical code it's pretty obvious a lot more code could be shared.

A frequent reason for copy/paste/diverge is the lack of validation resources to test refactored code on the older hardware. This lack never gets better.

PS: my "request changes" is only about not breaking scripts/xtensa-build-all.sh -a

Hi March

Renoir and Rembrandt have different architecture. Currently we cannot share, but in future we will look at restructuring.

When diff -w -b shows 80-90% identical code it's pretty obvious a lot more code could be shared.

A frequent reason for copy/paste/diverge is the lack of validation resources to test refactored code on the older hardware. This lack never gets better.

PS: my "request changes" is only about not breaking scripts/xtensa-build-all.sh -a

Hi Marc
overlay and corresponding configs got up streamed for rembrandt platform. So with above patch sets GCC buildwont break.
Quoting the Pull requests for refrence
thesofproject/crosstool-ng#16
thesofproject/xtensa-overlay#13

@lgirdwood

Copy link
Copy Markdown
Member

@balakishorepati I think we just need a little cleanup (as most comments seem to be around items that checkpatch will complain about), the while loop discussed above is functionally correct but just with an unnecessary if(true). There is some duplication though and I would recommend future PRs which allow more reuse here to lower your maintenance effort.

@bhiregoudar

Copy link
Copy Markdown

Definitely we will try to restructure for the ease of maintenance in future PR's or future platforms. Currently tied up with other priority activities
Thanks for the support.

@marc-hb

marc-hb commented Jun 3, 2022 •

Copy link
Copy Markdown
Collaborator

overlay and corresponding configs got up streamed for rembrandt platform. So with above patch sets GCC buildwont break. Quoting the Pull requests for refrence

Great, thank you! Unfortunately that's not enough, the Docker image was updated yesterday (thanks @fredoh9 ) yet this still fails:

https://github.com/thesofproject/sof/runs/6726868733?check_suite_focus=true

CMake Error at CMakeLists.txt:39 (project):
  The CMAKE_C_COMPILER:
    xtensa-rmb-elf-gcc
  is not a full path and was not found in the PATH.

@fredoh9 any idea why rmb is still missing in the latest Docker image?

Until that is resolved don't change DEFAULT_PLATFORMS and do this instead:

--- a/scripts/xtensa-build-all.sh
+++ b/scripts/xtensa-build-all.sh
@@ -12,7 +12,7 @@ DEFAULT_PLATFORMS=(  byt cht bdw hsw apl skl kbl cnl sue icl jsl \
 
 # Work in progress can be added to this "staging area" without breaking
 # the -a option for everyone.
-SUPPORTED_PLATFORMS=( "${DEFAULT_PLATFORMS[@]}" )
+SUPPORTED_PLATFORMS=( "${DEFAULT_PLATFORMS[@]}" rmb )
 
 BUILD_ROM=no
 BUILD_DEBUG=no

Currently tied up with other priority activities

We all know this; fixing copy/paste/diverge and other technical debt is never the priority :-)

@cujomalainey cujomalainey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please try and increase code reuse

Comment thread src/drivers/amd/rembrandt/acp_bt_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_bt_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel like given how often this exact switch is used, it actually might be better off as a helper

Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_dmic_dai.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_dmic_dai.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_sp_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated
Comment thread src/drivers/amd/rembrandt/acp_bt_dai.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete prefix

Comment thread src/drivers/amd/rembrandt/acp_bt_dma.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete error prefix, its part of the trace type

Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix

Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix

Comment thread src/drivers/amd/rembrandt/acp_dma.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix

Comment thread src/drivers/amd/rembrandt/acp_hs_dma.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix

Comment thread src/drivers/amd/rembrandt/acp_sp_dma.c Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefix

@fredoh9

fredoh9 commented Jun 7, 2022 •

Copy link
Copy Markdown
Contributor

I updated the sof build docker image(= thesofproject/sof) and added rmb gcc toolchain.
But I can't build rembrandt(rmb) image. There are build errors. Can you double check if you can build it with the gcc compiler?
thesofproject/sof:latest (=thesofproject/sof:20220606) is the image.

[ 15%] Building ASM object src/arch/xtensa/CMakeFiles/reset.dir/xtos/reset-vector.S.o
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S: Assembler messages:
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:850: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:863: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:863: Error: unknown opcode or format name 'wsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:880: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:893: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:893: Error: unknown opcode or format name 'wsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:893: Error: unknown opcode or format name 'diwbui.p'
...

@lgirdwood

lgirdwood commented Jun 10, 2022 •

Copy link
Copy Markdown
Member

I updated the sof build docker image(= thesofproject/sof) and added rmb gcc toolchain. But I can't build rembrandt(rmb) image. There are build errors. Can you double check if you can build it with the gcc compiler? thesofproject/sof:latest (=thesofproject/sof:20220606) is the image.

[ 15%] Building ASM object src/arch/xtensa/CMakeFiles/reset.dir/xtos/reset-vector.S.o
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S: Assembler messages:
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:850: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:863: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:863: Error: unknown opcode or format name 'wsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:880: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:893: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:893: Error: unknown opcode or format name 'wsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/hal/cache_asm.S:893: Error: unknown opcode or format name 'diwbui.p'
...

This means either 3 things

  1. We have the wrong GCC compiler in docker.
  2. We have the wrong xtensa xplorer overlay used to build the RMB GCC.
  3. We have the wrong config in the RMB core-isa.h (i.e there is a mismatch where core-isa.h says memctl is supported but xplorer overlay says it's not supported in the RMB config).

@fredoh9 you can only check item 1, @balakishorepati will need to check items 2 & 3

@balakishorepati

Copy link
Copy Markdown
Contributor Author

@lgirdwood : The issue is due to crosstool-ng was not picking up the proper cor-isa.h file from rmb_overlay during tarball extraction. Due this build failures were coming. Need to see why crosstool-ng was not picking the proper core-isa.h header from rmb overlay.

@lgirdwood

Copy link
Copy Markdown
Member

@lgirdwood : The issue is due to crosstool-ng was not picking up the proper cor-isa.h file from rmb_overlay during tarball extraction. Due this build failures were coming. Need to see why crosstool-ng was not picking the proper core-isa.h header from rmb overlay.

Btw, I'm updating GCC to v11 (which has static analysis) and can see

[ 98%] Building C object CMakeFiles/sof.dir/src/schedule/timer_domain.c.o
/home/lrg/work/sof/sof/src/drivers/amd/renoir/acp_sp_dma.c: In function 'acp_dai_sp_dma_set_config':
/home/lrg/work/sof/sof/src/drivers/amd/renoir/acp_sp_dma.c:215:17: error: 'memset' offset [0, 511] is out of the bounds [0, 0] [-Werror=array-bounds]
  215 |                 memset((void *)sp_fifo_addr, 0, SP_FIFO_SIZE);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lrg/work/sof/sof/src/drivers/amd/renoir/acp_sp_dma.c:235:17: error: 'memset' offset [0, 511] is out of the bounds [0, 0] [-Werror=array-bounds]
  235 |                 memset((void *)sp_fifo_addr, 0, SP_FIFO_SIZE);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[100%] Linking C executable rimage
cc1: all warnings being treated as errors
gmake[3]: *** [CMakeFiles/sof.dir/build.make:1347: CMakeFiles/sof.dir/src/drivers/amd/renoir/acp_sp_dma.c.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
[100%] Built target rimage
[100%] No install step for 'rimage_ep'
[100%] Completed 'rimage_ep'
[100%] Built target rimage_ep
gmake[2]: *** [CMakeFiles/Makefile2:1989: CMakeFiles/sof.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:2367: src/arch/xtensa/CMakeFiles/bin.dir/rule] Error 2
gmake: *** [Makefile:923: bin] Error 2

Which looks like we have a mismatch between array sizes ?

@balakishorepati

Copy link
Copy Markdown
Contributor Author

@lgirdwood : The issue is due to crosstool-ng was not picking up the proper cor-isa.h file from rmb_overlay during tarball extraction. Due this build failures were coming. Need to see why crosstool-ng was not picking the proper core-isa.h header from rmb overlay.

Btw, I'm updating GCC to v11 (which has static analysis) and can see

[ 98%] Building C object CMakeFiles/sof.dir/src/schedule/timer_domain.c.o
/home/lrg/work/sof/sof/src/drivers/amd/renoir/acp_sp_dma.c: In function 'acp_dai_sp_dma_set_config':
/home/lrg/work/sof/sof/src/drivers/amd/renoir/acp_sp_dma.c:215:17: error: 'memset' offset [0, 511] is out of the bounds [0, 0] [-Werror=array-bounds]
  215 |                 memset((void *)sp_fifo_addr, 0, SP_FIFO_SIZE);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lrg/work/sof/sof/src/drivers/amd/renoir/acp_sp_dma.c:235:17: error: 'memset' offset [0, 511] is out of the bounds [0, 0] [-Werror=array-bounds]
  235 |                 memset((void *)sp_fifo_addr, 0, SP_FIFO_SIZE);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[100%] Linking C executable rimage
cc1: all warnings being treated as errors
gmake[3]: *** [CMakeFiles/sof.dir/build.make:1347: CMakeFiles/sof.dir/src/drivers/amd/renoir/acp_sp_dma.c.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
[100%] Built target rimage
[100%] No install step for 'rimage_ep'
[100%] Completed 'rimage_ep'
[100%] Built target rimage_ep
gmake[2]: *** [CMakeFiles/Makefile2:1989: CMakeFiles/sof.dir/all] Error 2
gmake[1]: *** [CMakeFiles/Makefile2:2367: src/arch/xtensa/CMakeFiles/bin.dir/rule] Error 2
gmake: *** [Makefile:923: bin] Error 2

Which looks like we have a mismatch between array sizes ?

Is the build for renoir(rn) or rembrandt(rmb) ?

@lgirdwood

Copy link
Copy Markdown
Member

Is the build for renoir(rn) or rembrandt(rmb) ?

renoir with GCC11. You will need to locally install atm.

https://github.com/thesofproject/crosstool-ng/releases/tag/gcc11.2

@fredoh9

fredoh9 commented Jun 13, 2022

Copy link
Copy Markdown
Contributor

We have the wrong GCC compiler in docker.

Current docker image is based on Ubuntu 20.04, GCC version is 9.4.0

$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

Add rembrandt build support.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
Add drivers for:
            * timer, ipc, interrupt - amd specific implementation
            * DMA, for copying data between HOST and DSP
            * BT DAI,SP DAI, HS DAI for Audio interface
            * I2S DMA, Controller for BT,SP and HS

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
This adds support for platform drivers (dai, dma, clk)
and general platform initialization.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
Add support for hs i2s instance on rembrandt
platform.

Signed-off-by: Balakishorepati <balaKishore.pati@amd.com>
@lgirdwood

Copy link
Copy Markdown
Member

We have the wrong GCC compiler in docker.

Current docker image is based on Ubuntu 20.04, GCC version is 9.4.0

$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

Ok, looks like Rembrandt is building now. @fredoh9 can you confirm ?

@marc-hb
marc-hb dismissed their stale review June 14, 2022 15:28

shell script fixed

@marc-hb marc-hb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the commits has https://github.com/thesofproject/sof/runs/6873676802?check_suite_focus=true

total: 955 errors, 371 warnings, 5108 lines checked

Checkpatch is not always right but many of these seem very easy to fix; at least all the whitespace ones are easy to fix. Getting the number down would make it possible not to miss more important ones like:

ERROR: Use of the '__DATE__' macro makes the build non-deterministic
#4713: FILE: src/platform/amd/rembrandt/platform.c:54:
+		.date = __DATE__,

@lgirdwood

Copy link
Copy Markdown
Member

We have the wrong GCC compiler in docker.

Current docker image is based on Ubuntu 20.04, GCC version is 9.4.0

$ gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

Ok, looks like Rembrandt is building now. @fredoh9 can you confirm ?

@marc-hb do we have a plan for GCC11.x here ? It has the static analysis that is flagging up an issue (but lets get this PR merged first).

@marc-hb

marc-hb commented Jun 14, 2022 •

Copy link
Copy Markdown
Collaborator

Ok, looks like Rembrandt is building now

This PR is not trying to build it. I don't think @balakishorepati has done the Docker work yet.

GitHub Actions / gcc-build-only (rn) (pull_request) Successful in 1m

@marc-hb do we have a plan for GCC11.x here ?

No idea sorry.

@marc-hb

marc-hb commented Jun 14, 2022

Copy link
Copy Markdown
Collaborator

In #5918 I tried to build this with Docker and gcc with the corresponding one-line change in .github/workflows/ and it failed in a way that I did not expect:

https://github.com/thesofproject/sof/runs/6884676831

[  5%] Building ASM object src/arch/xtensa/CMakeFiles/reset.dir/xtos/reset-vector.S.o
/home/sof/work/sof.git/src/arch/xtensa/xtos/reset-vector.S: Assembler messages:
/home/sof/work/sof.git/src/arch/xtensa/xtos/reset-vector.S:146: Error: unknown opcode or format name 'wsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/xtos/reset-vector.S:306: Error: unknown opcode or format name 'wsr.atomctl'
/home/sof/work/sof.git/src/arch/xtensa/xtos/reset-vector.S:353: Error: invalid register number (40) for 'wsr' instruction
/home/sof/work/sof.git/src/arch/xtensa/xtos/reset-vector.S:447: Error: unknown opcode or format name 'rsr.memctl'
/home/sof/work/sof.git/src/arch/xtensa/xtos/reset-vector.S:456: Error: unknown opcode or format name 'wsr.memctl'
make[3]: *** [src/arch/xtensa/CMakeFiles/reset.dir/build.make:70: src/arch/xtensa/CMakeFiles/reset.dir/xtos/reset-vector.S.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:2088: src/arch/xtensa/CMakeFiles/reset.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....

@sunilkumardommati

Copy link
Copy Markdown
Contributor

@lgirdwood @marc-hb ,
Currently we are facing issues with crosstool-ng copying core-isa.h from newlib (with XCHAL_CORE_ID "lx106") and not from rembrandt overlay files, which seems to be causing these compilation issues.
This is random behavior as few times it copied correct core-isa file and compilation was successful.
Any idea on why is that happening?

In the mean time, can we bypass this rembrandt from docker build and merge these patches?

@lgirdwood

Copy link
Copy Markdown
Member

@lgirdwood @marc-hb , Currently we are facing issues with crosstool-ng copying core-isa.h from newlib (with XCHAL_CORE_ID "lx106") and not from rembrandt overlay files, which seems to be causing these compilation issues. This is random behavior as few times it copied correct core-isa file and compilation was successful. Any idea on why is that happening?

I suspect this is related to the core-isa.h being out of sync with the overlay files from xplorer. i.e. it looks like core-isa.h has MEMCTL enabled but overlay has MEMCTL disabled. I would raise this with Cadence for a solution.

In the mean time, can we bypass this rembrandt from docker build and merge these patches?

Sure, we can merge now and add the build once a fix has been identified..

@lgirdwood
lgirdwood merged commit 83ee5b4 into thesofproject:main Jun 15, 2022
@marc-hb

marc-hb commented Jun 15, 2022

Copy link
Copy Markdown
Collaborator

In the mean time, can we bypass this rembrandt from docker build and merge these patches?

Not building rembrandt in CI means no one will notice when it breaks. This is what happened with mt8186 and mt8195 in 42e0d5e (later addressed with 425a5b5)

Now this hopefully less likely to happen with rembrandt considering it's mostly a copy of renoir which is currently built in CI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants