Skip to content

Conversation

@jjdalynh
Copy link
Contributor

@jjdalynh jjdalynh commented Nov 5, 2024

LJ packages have 16 ADC channels vs 8 for SZ packages. Enhance devicetree to account for this as well as conditional defines/code.

@zephyrbot zephyrbot added platform: Microchip MEC Microchip MEC Platform area: ADC Analog-to-Digital Converter (ADC) labels Nov 5, 2024
@jjdalynh jjdalynh force-pushed the mec_adc_channels branch 7 times, most recently from 093f95c to 7e1d8c7 Compare November 5, 2024 17:27
Copy link
Contributor

@scottwcpg scottwcpg left a comment

Choose a reason for hiding this comment

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

Please remove all MEC174x and MEC175x stuff from this PR.
These two code bases cannot be mixed together due to Google rejecting the use of HAL's.

Copy link
Contributor

Choose a reason for hiding this comment

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

NO. Please DO NOT add MEC1743 and MEC1753 to this code!
MEC174x, MEC175x, and all future chips will be based on a the new MEC5 HAL and will NOT EVER use the old MEC172x drivers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

is there some documentation regarding the 'MEC5 HAL' and it's use cases or restrictions/limits? I will update the PR, but i'd like it if there was some guidance i could follow (other than 'ignore MEC17[45]x for MEC150x/MEC172x driver updates')

Copy link
Contributor

Choose a reason for hiding this comment

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

The new MEC5 HAL is a work in progress.
The HAL was created due to the request of yet another large customer. The original goal for MEC5 HAL were all chips after MEC172x. Since the customer demanded no direct HW register access in the drivers we can't use the current MEC172x drivers. This meant new SoC, boards, drivers, etc as if MEC5 are completely different chips. Unfortunately, said customer came back and demanded MEC172x be added to MEC5 HAL. It is a huge mess with no good solution so the rule is:
MEC152x uses old header files from hal_microchip/mec folder
MEC172x does not use any header/code from hal_microchip due to Google chromebook Zephyr requirement.
MEC174x, MEC175x, and hopefully all future chips will use hal_microchip/mec5 headers and peripheral C code.
MEC174x, MEC175x require new SoC, DTS, board, and drivers.
Their are only a new select header files that may be shared: the GPIO dt-bindings and PINCTRL dt-bindings. Anything else is not shared because we don't want to break legacy MEC172x.
No one is happy about it.

LJ packages have 16 ADC channels vs 8 for SZ packages.  Enhance
devicetree to account for this as well as conditional defines/code.

Signed-off-by: Jeff Daly <[email protected]>
@jjdalynh
Copy link
Contributor Author

ping. is this to be merged?

@kartben kartben merged commit 371ca13 into zephyrproject-rtos:main Dec 11, 2024
23 checks passed
@jvasanth1
Copy link
Contributor

Hi @jjdalynh ,

Can you confirm this PR has been tested on both the LJ and SZ packages?

@jvasanth1
Copy link
Contributor

We are seeing exception on SZ package, in the adc_xec_init function when the config register is accessed. The code is accessing offset 0x5C for the config register when actually the config register is at 0x7C offset.

Can you create a PR to fix this?

@jvasanth1
Copy link
Contributor

This issue was pointed out when the changes where done initially here
#66718

image

@jjdalynh
Copy link
Contributor Author

jjdalynh commented Dec 19, 2024 via email

jjdalynh added a commit to silicom-ltd/zephyr-to-upstream that referenced this pull request Dec 23, 2024
Fixed bug calculating offset of registers after unused space in the ADC
register space for the SZ package parts.

Signed-off-by: Jeff Daly <[email protected]>
kartben pushed a commit that referenced this pull request Dec 23, 2024
Fixed bug calculating offset of registers after unused space in the ADC
register space for the SZ package parts.

Signed-off-by: Jeff Daly <[email protected]>
soburi pushed a commit to soburi/zephyr that referenced this pull request Dec 28, 2024
Fixed bug calculating offset of registers after unused space in the ADC
register space for the SZ package parts.

Signed-off-by: Jeff Daly <[email protected]>
Devansh0210 pushed a commit to Devansh0210/zephyr that referenced this pull request Jan 7, 2025
Fixed bug calculating offset of registers after unused space in the ADC
register space for the SZ package parts.

Signed-off-by: Jeff Daly <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ADC Analog-to-Digital Converter (ADC) platform: Microchip MEC Microchip MEC Platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants