Skip to content

Conversation

@abonislawski
Copy link
Member

The ALH is an intermediary device, which acts as a hub and provides an
abstracted support for numerous sound interfaces (e.g. SoundWire).

@github-actions github-actions bot added area: API Changes to public APIs area: Devicetree area: Devicetree Binding PR modifies or adds a Device Tree binding area: Samples Samples labels Apr 25, 2022
@abonislawski abonislawski marked this pull request as ready for review April 26, 2022 06:38
@zephyrbot zephyrbot added area: Audio area: Xtensa Xtensa Architecture labels Apr 26, 2022
@marc-hb marc-hb removed their request for review April 26, 2022 21:19
@abonislawski
Copy link
Member Author

@marcinszkudlinski @nashif please review

Copy link
Contributor

Choose a reason for hiding this comment

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

label is also required, pls add

Copy link
Contributor

Choose a reason for hiding this comment

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

Can I ask why label is required?

Copy link
Contributor

Choose a reason for hiding this comment

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

somehow we need to bind to the device.

@abonislawski abonislawski force-pushed the zephyr_dai_alh_upstream branch from 984a5f6 to 106feef Compare May 23, 2022 15:23
@abonislawski
Copy link
Member Author

Updated with unified version (cavs & ace supported)

@abonislawski abonislawski force-pushed the zephyr_dai_alh_upstream branch from 106feef to 483c20e Compare May 23, 2022 15:28
@kv2019i kv2019i added the platform: Intel ADSP Intel Audio platforms label May 24, 2022
@kv2019i kv2019i requested a review from juimonen May 24, 2022 10:46
@abonislawski abonislawski requested review from dcpleung and mwasko and removed request for dcpleung and marcinszkudlinski May 25, 2022 15:47
@dcpleung
Copy link
Member

Since you are adding SET_BITS() in sys/util_macros.h, it conflicts with the one in drivers/audio/intel_dmic.c

@abonislawski abonislawski force-pushed the zephyr_dai_alh_upstream branch from c3f47bb to 504b128 Compare May 25, 2022 16:44
@abonislawski abonislawski requested a review from tbursztyka as a code owner May 25, 2022 16:44
@abonislawski abonislawski force-pushed the zephyr_dai_alh_upstream branch from 504b128 to e37bb46 Compare May 25, 2022 16:46
Extend dai properties with stream ID parameter

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
@abonislawski
Copy link
Member Author

abonislawski commented May 25, 2022

Since you are adding SET_BITS() in sys/util_macros.h, it conflicts with the one in drivers/audio/intel_dmic.c

Yes, I see in the logs, hopefully this time it will pass every check

EDIT: sorry, reverted to original form with copy in alh.h, there are tons of SET_BITS definitions

@abonislawski abonislawski force-pushed the zephyr_dai_alh_upstream branch from e37bb46 to cbfd056 Compare May 25, 2022 17:15
juimonen
juimonen previously approved these changes May 25, 2022
Copy link

@juimonen juimonen left a comment

Choose a reason for hiding this comment

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

CI looks green now and dai properties is a separate commit. I can't test the actual driver myself now, but I trust you have tested it. kudos for cavs25 dtsi -> this will be tested a lot for sure (other than fpga). so LGTM.

dcpleung
dcpleung previously approved these changes May 25, 2022
Comment on lines +63 to +64
Copy link
Member

Choose a reason for hiding this comment

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

Why is this hard coded to instance 0? Will this driver work for multiple instances?

Copy link
Member Author

Choose a reason for hiding this comment

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

They are the same for every instance so it doesnt matter but how to do it in more clean way?

Choose a reason for hiding this comment

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

For starters, it is recommended to comment usage of a hardcode.

Comment on lines +74 to +75
Copy link
Member

Choose a reason for hiding this comment

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

Same question about hard coded instance

Copy link
Member

Choose a reason for hiding this comment

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

Please stay with this approach

Comment on lines +39 to +43
Copy link
Member

Choose a reason for hiding this comment

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

These might be better as devicetree properties

cc: @laurenmurphyx64

Copy link
Member

Choose a reason for hiding this comment

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

The first value here needs to match the value in line 262; otherwise you will get a build warning. Twister converts build warnings to errors but this PR somehow passes CI, so is there a sample or test application configuration that builds with this new driver?

Copy link
Contributor

Choose a reason for hiding this comment

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

@MaureenHelm is there a "clean" way to create several instances of a driver with the same set of registers?

Copy link
Member Author

@abonislawski abonislawski May 26, 2022

Choose a reason for hiding this comment

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

Changed both of them to alh@24400, surprisingly it builds without warnings (previously there was a warning as you said but it was not treated as error in cavs25 CI), is that correct?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe twister only converts compiler warnings to errors, and not devicetree warnings too? What caught my attention in your previous version was the odd base address ending in 1. Also, is the second value here an address? It looks like an address, but it should be the size of the memory region.

Why are there multiple instances of the driver at the same address? How do you decide how many driver instances there should be? Is it a property of the hardware?

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe twister only converts compiler warnings to errors, and not devicetree warnings too?

I remember I had to fix two issues in #41706 to stop -Wa,--fatal-warnings from being ignored. I see --edtlib-Werror in the same place but maybe it's being ignored too because of some other bug?

If it's not tested then it does not work and error handling is rarely ever tested. It took a number of coincidences to notice that -Wa,--fatal-warnings was being ignored.

@abonislawski abonislawski dismissed stale reviews from dcpleung and juimonen via 2329316 May 26, 2022 07:28
@abonislawski abonislawski force-pushed the zephyr_dai_alh_upstream branch from cbfd056 to 2329316 Compare May 26, 2022 07:28
Copy link
Member

Choose a reason for hiding this comment

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

If you add this before config,

DT_COMPAT_INTEL_ALH_DAI := intel,alh-dai

and this inside config

default $(dt_compat_enabled,$(DT_COMPAT_INTEL_ALH_DAI))

This will allow the driver to be enabled whenever a devicetree node has the compatible value is enabled. This will allow CI to build this driver for cAVS 2.5

Copy link
Member Author

@abonislawski abonislawski May 26, 2022

Choose a reason for hiding this comment

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

Sure, we can do it later but for now @juimonen requested to not enabling this driver until sof can use it (changes in review)

Copy link
Member

Choose a reason for hiding this comment

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

No, it needs to be enabled somewhere before we can merge it. Otherwise, it will not be included in CI and we won't know if it even builds.

Copy link
Contributor

Choose a reason for hiding this comment

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

@abonislawski @juimonen I think we can proceed with a) a test case, b) enable it for cAVS2.5 SOF build, c) add a new board file using this.

Copy link
Member Author

Choose a reason for hiding this comment

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

@dcpleung @MaureenHelm driver enabled again as you requested, hopefully it will pass CI :)

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @abonislawski

Copy link
Member

Choose a reason for hiding this comment

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

No, it needs to be enabled somewhere before we can merge it. Otherwise, it will not be included in CI and we won't know if it even builds.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe twister only converts compiler warnings to errors, and not devicetree warnings too? What caught my attention in your previous version was the odd base address ending in 1. Also, is the second value here an address? It looks like an address, but it should be the size of the memory region.

Why are there multiple instances of the driver at the same address? How do you decide how many driver instances there should be? Is it a property of the hardware?

@abonislawski abonislawski force-pushed the zephyr_dai_alh_upstream branch from 2329316 to 2c25f09 Compare May 31, 2022 06:39
The ALH is an intermediary device, which acts as a hub and provides an
abstracted support for numerous sound interfaces (e.g. SoundWire).

Signed-off-by: Adrian Bonislawski <adrian.bonislawski@intel.com>
Copy link
Member

Choose a reason for hiding this comment

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

Thanks @abonislawski

@carlescufi carlescufi merged commit 638cfbb into zephyrproject-rtos:main Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: API Changes to public APIs area: Audio area: Devicetree Binding PR modifies or adds a Device Tree binding area: Devicetree area: Samples Samples area: Xtensa Xtensa Architecture platform: Intel ADSP Intel Audio platforms

Projects

None yet

Development

Successfully merging this pull request may close these issues.