Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

soc: arc: remove <soc.h> usage #46585

Merged
merged 19 commits into from
Aug 3, 2022
Merged

Conversation

gmarull
Copy link
Member

@gmarull gmarull commented Jun 15, 2022

<soc.h> has traditionally been used as a proxy to HAL headers,
register definitions, etc. Nowadays, <soc.h> is anarchy. It serves a
different purpose depending on the SoC. In some cases, it includes HALs,
in some others, it works as a header sink/proxy (for no good reason), as
a register definition when there's no HAL (bypassing the purpose of DT in some cases…).
To make things worse, it is being included in code that is, in theory, non-SoC specific.

This patch is part of a series intended to improve the situation by
removing <soc.h> usage when not needed, and by eventually removing it.

NOTE: I have zero ARC knowledge, so some patches may not contain the best solution (specially the DT part).

Related to #46147 and #41543

andyross
andyross previously approved these changes Jun 16, 2022
sysconf source file is the only user of such definition, so move it
there.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The definition is not used, so remove it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The definitions provided by this file seem to be unused throughout the
tree, so remove it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
sysconf base address was hardcoded in <soc.h>. Create a new compatible
and define it in Devicetree, where hardware needs to be described.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Remove definitions not used in any C unit throughout the tree.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
ICI (Inter-Core Interrupt Unit) interrupts and priorities were hardcoded
in C files. This patch moves this information to Devicetree and updates
code to make use of it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The <soc.h> header is not required by a few ARC/Designware drivers, so
remove it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Header was not used, so remove it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Header was not used, so remove it. Add other necessary includes as part
of the removal.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The soc.c source only contains code relevant to SMP, and in fact, it is
a file that is left empty when pre-processed from a compiler perspective
if CONFIG_SMP=n. This change renames it to smp.c to make it clear it
contains SMP related code, and, it compiles it conditionally to
CONFIG_SMP=y.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Include only what is needed.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
soc.c was empty, so just delete it.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
Include only what is needed in soc_config.c

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
The ARC <soc.h> headers are no longer used, so they can be removed.
Refer to the previous commits for more context.

Signed-off-by: Gerard Marull-Paretas <gerard.marull@nordicsemi.no>
@gmarull gmarull removed DNM This PR should not be merged (Do Not Merge) labels Jul 15, 2022
@gmarull
Copy link
Member Author

gmarull commented Jul 15, 2022

@evgeniy-paltsev @ruuddw please check latest changes

Copy link
Member

@ruuddw ruuddw left a comment

Choose a reason for hiding this comment

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

Thanks!
(but let's wait for Evgeniy's final testing/ack)

@gmarull
Copy link
Member Author

gmarull commented Aug 2, 2022

@evgeniy-paltsev gentle ping

@evgeniy-paltsev
Copy link
Collaborator

Hi @gmarull,

I've tested this finally - everything is OK now, thanks!

@gmarull
Copy link
Member Author

gmarull commented Aug 3, 2022

Hi @gmarull,

I've tested this finally - everything is OK now, thanks!

can you approve then?

@nashif nashif merged commit 83d73f6 into zephyrproject-rtos:main Aug 3, 2022
@gmarull gmarull deleted the arc-soc-cleanup branch August 3, 2022 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants