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

Open Alliance SPI support #2438

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Open Alliance SPI support #2438

wants to merge 4 commits into from

Conversation

CiprianRegus
Copy link
Contributor

@CiprianRegus CiprianRegus commented Feb 6, 2025

Pull Request Description

Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

@CiprianRegus CiprianRegus marked this pull request as draft February 6, 2025 11:50
@CiprianRegus CiprianRegus force-pushed the staging/oa_spi branch 3 times, most recently from 095c651 to fa90171 Compare February 10, 2025 13:17
The Open Alliance serial interface (OA TC6) is a protocol over an SPI
bus, used for full duplex Ethernet frame transfer between a host
processor and a 10BASE-T1L or 10BASE-T1S MAC. Implement a generic
framework, which can be used to control any MAC which supports the OA
SPI protocol.

Protocol spec: https://opensig.org/wp-content/uploads/2023/12/OPEN_Alliance_10BASET1x_MAC-PHY_Serial_Interface_V1.1.pdf

Signed-off-by: Ciprian Regus <[email protected]>
Add support for the Open Alliance SPI protocol, which can be used as an
alternative to the current generic SPI.

Signed-off-by: Ciprian Regus <[email protected]>
Add the option to use the Open Alliance SPI protocol for the ADIN1110.
In order to enable it, the project has to be compiled with the
CONFIG_SWIOT1L_OA_TC6_SPI=y make flag.

Signed-off-by: Ciprian Regus <[email protected]>
The OA TC6 SPI files are required to compile the ADIN1110 driver. Add
them to the projects which use the MAC-PHY.

Signed-off-by: Ciprian Regus <[email protected]>
@CiprianRegus CiprianRegus marked this pull request as ready for review February 11, 2025 11:28
#define OA_HEADER_LEN 4
#define OA_FOOTER_LEN 4

#define OA_MMS_REG(m, r) (((m) << 16) | ((r) & NO_OS_GENMASK(15, 0)))
Copy link
Contributor

@buha buha Feb 11, 2025

Choose a reason for hiding this comment

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

tbh i like & 0xffff better because it's shorter :D no need to change, just saying

@@ -38,6 +38,9 @@
#include "no_os_spi.h"
#include "no_os_gpio.h"
#include "no_os_util.h"
#include "no_os_irq.h"

#include "oa_tc6.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

you'll have to adjust more src.mk files in all affected projects

drivers/net/adin1110/adin1110.h:43:10: fatal error: oa_tc6.h: No such file or directory

@@ -38,6 +38,9 @@
#include "no_os_spi.h"
#include "no_os_gpio.h"
#include "no_os_util.h"
#include "no_os_irq.h"
Copy link
Contributor

Choose a reason for hiding this comment

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

this might also have an impact, i didn't check the CI, depending on whether existing projects include .h files one by one or using NO_OS_INC_DIRS

Copy link
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 left over from a previous implementation and is not needed anymore. I'll remove it.

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.

2 participants