Skip to content

bootloader: enable LPSRAM memory for cannonlake - #1552

Merged
jajanusz merged 7 commits into
thesofproject:masterfrom
mrajwa:ghw_dev
Jul 30, 2019
Merged

jajanusz merged 7 commits into
thesofproject:masterfrom
mrajwa:ghw_dev

Conversation

@mrajwa

@mrajwa mrajwa commented Jun 12, 2019

Copy link
Copy Markdown
Contributor

Signed-off-by: Marcin Rajwa marcin.rajwa@linux.intel.com

@mrajwa
mrajwa requested a review from tlauda as a code owner June 12, 2019 09:45

@tlauda tlauda 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.

Could we create something like CONFIG_LP_SRAM?
Adding additional platforms is not a good idea.

@mrajwa

mrajwa commented Jun 12, 2019

Copy link
Copy Markdown
Contributor Author

Yes this is good idea I think.

@lgirdwood lgirdwood left a comment

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.

Commit message.

Comment thread Kconfig 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.

config LP_SRAM

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.

Why its not "depends on CAVS" if LP_MEMORY_BANKS depends on CAVS?

Anyway the best option:
LP_SRAM should depends on CAVS and LP_MEMORY_BANKS depends on LP_SRAM

@tlauda tlauda 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.

You are not selecting LP_SRAM for any platform.

Comment thread src/arch/xtensa/boot_loader.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.

Better to use #if CONFIG_LP_SRAM.

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.

The question is should we enable LPSRAM in defconfig? And if so for what platforms?

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.

we can select LP_SRAM under platform config, e.g. select LP_SRAM under CONFIG_APOLLOLAKE and CONFIG_CANNOLAKE.

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.

@mrajwa I would expect to have it enabled by default for APL and CNL.

Comment thread src/arch/xtensa/boot_loader.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.

It got a bit messy, we have LSPGCTL once used as shim (here) and another time as just memory mng register to turn it off at all (in asm_memory_management). Please clean it up.

Comment thread Kconfig Outdated

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.

Why its not "depends on CAVS" if LP_MEMORY_BANKS depends on CAVS?

Anyway the best option:
LP_SRAM should depends on CAVS and LP_MEMORY_BANKS depends on LP_SRAM

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.

With this change you will have whole LP_SRAM for heap buffer but also in the same place there will be heaps like HEAP_LP_SYSTEM_BASE or HEAP_LP_RUNTIME_BASE, change them if not needed

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.

@abonislawski, and this is the intention we need whole LPSRAM for heap buffer.

@abonislawski abonislawski Jun 13, 2019 •

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.

@mrajwa I mean in this case not needed defines like HEAP_LP_RUNTIME_BASE should be deleted to make this clear because right now two defines will point to the same memory and we need to check which one is actually used

@mrajwa
mrajwa force-pushed the ghw_dev branch 2 times, most recently from 3f351c8 to 3a0cfd6 Compare June 13, 2019 23:33

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.

Ending newline pls

To be able to use register read interfaces like shim_read()
we need to specify offset. This patch adds such offset for
LSPGCTL register.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
@mrajwa mrajwa added the P1 Blocker bugs or important features label Jul 25, 2019
@mrajwa

mrajwa commented Jul 25, 2019

Copy link
Copy Markdown
Contributor Author

CI fails because FW touches LP related defines even though they have been disabled. I will commit further in regards to this.

@mrajwa

mrajwa commented Jul 26, 2019

Copy link
Copy Markdown
Contributor Author

@jajanusz @tlauda does it look OK now?

@tlauda tlauda 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.

Small style change and we're good to go.

Comment thread src/arch/xtensa/boot_loader.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.

Go with the rest of the source code: #if.

Comment thread src/arch/xtensa/boot_loader.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.

Ditto.

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.

#if

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.

#if

@mrajwa

mrajwa commented Jul 26, 2019

Copy link
Copy Markdown
Contributor Author

@tlauda, updated.

@tlauda tlauda 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.

@jajanusz Do you know what is the meaning of checkpatch complain?

@mrajwa

mrajwa commented Jul 26, 2019 •

Copy link
Copy Markdown
Contributor Author

@tlauda I found it complains -> "WARNING: please write a paragraph that describes the config symbol fully... FILE: Kconfig:28"

@mrajwa

mrajwa commented Jul 26, 2019

Copy link
Copy Markdown
Contributor Author

@tlauda @jajanusz, I have fixed that checkpatch warning also.

@jajanusz

Copy link
Copy Markdown
Contributor

@jajanusz Do you know what is the meaning of checkpatch complain?

@tlauda I found it complains -> "WARNING: please write a paragraph that describes the config symbol fully... FILE: Kconfig:28"

Yea, for checkpatch fully means 4 lines ;) No need to always satisfy this check as sometimes there are not so much to write about config

Comment thread Kconfig Outdated
Comment thread Kconfig 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.

no need for depends here (as above)

Comment thread Kconfig 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 think you may remove and all related defines will return zero, it's better not to write implemenation details, especially when this statement is not true, because it will result in different (0/false/undefined) values depending in what enviroment config is used (fe cmake/make vs C preprocessor vs C compiler).

@jajanusz
jajanusz requested a review from abonislawski July 26, 2019 16:13
@jajanusz
jajanusz dismissed stale reviews from abonislawski and lgirdwood July 26, 2019 16:13

Stale review, feel free to rereview tho.

@jajanusz
jajanusz requested a review from lgirdwood July 26, 2019 16:16
mrajwa added 3 commits July 29, 2019 10:41
Choose to power ON LPSRAM banks in Kconfig menu.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch changes the rules of LPSRAM enabling.
Now it is no longer platform dependent but rather
rely on config selection.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
Enable whole LPSRAM bank to be allocated by heap buffer.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
mrajwa added 2 commits July 29, 2019 11:04
This patch enables LPSRAM memory by default on
all APL platforms.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
This patch enables LPSRAM memory by default on
all APL platforms.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>

@jajanusz jajanusz 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.

@mrajwa please squash UT commit with breaking commit

This patch sets all LPSRAM related memory defines to
zero if CONFIG_LP_MEMORY_BANKS is not defined.

Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
@jajanusz
jajanusz merged commit d180cd3 into thesofproject:master Jul 30, 2019
#define PLATFORM_LPSRAM_EBB_COUNT CONFIG_LP_MEMORY_BANKS
#else
#define PLATFORM_LPSRAM_EBB_COUNT 0
#endif

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.

@mrajwa , the preprocessor replaces undefined macros with 0 so I don't see when or how the newer and more convoluted code behaves differently from the previous code, can you explain? Besides moving any -Wundef warning to the previous line I couldn't find any difference.

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

Labels

P1 Blocker bugs or important features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants