summaryrefslogtreecommitdiff
path: root/drivers/net/dc2114x.c
AgeCommit message (Collapse)Author
2025-05-29net: dc2114x: Include env.h to permit reading the environmentSimon Glass
This file uses the environment but does not include the header file. Update it. Signed-off-by: Simon Glass <[email protected]>
2024-10-27Merge a patch series to improve dc2114x supportTom Rini
This patch series by Hanyuan Zhao <[email protected]> provides a number of improvements to the dc2114x driver. Link: https://lore.kernel.org/r/[email protected]
2024-10-27net: dc2114x: remove the pass all multicast flag in operation mode settingsHanyuan Zhao
Remove the OMR_PM flag and choose 16 perfect filtering mode since in modern networks there're plenty of multicasts and set ORM_PM flag will increase the dc2114x's workload and ask the U-Boot to handle packets not related to itself. And most of the time, U-Boot does not need this feature. Signed-off-by: Hanyuan Zhao <[email protected]>
2024-10-27net: dc2114x: allow users to decide how to tx packets according to IP coreHanyuan Zhao
Some IP cores of dc2114x or its variants do not comply so well with the behaviors described by the official document. Originally this driver uses only one tx descriptor and organizes it as a ring buffer, which would lead to a problem that one packet would be sent twice. This commit adds support to prevent this bug if you are using IP cores with this issue, by using multiple tx descriptors and organizing them as a real well-defined ring buffer. Signed-off-by: Hanyuan Zhao <[email protected]>
2024-10-27net: dc2114x: allow users to decide whether to detect the tx No Carrier errorsHanyuan Zhao
Some IP cores of dc2114x or its variants do not comply so well with the behaviors described by the official document. A packet could be sent successfully but reported with No Carrier error. Latest drivers of this IP core have not detect this error anymore. Signed-off-by: Hanyuan Zhao <[email protected]>
2024-10-27net: dc2114x: remove unused lines and change the var and print typesHanyuan Zhao
This commit fixes a problem that even though the network card does not report any issues in transmitting a setup frame, the driver prints the error status every time. Let's set it for debug use. Signed-off-by: Hanyuan Zhao <[email protected]>
2024-10-27net: dc2114x: add support for CPUs that have cache between the memory and ↵Hanyuan Zhao
the card This commit adds support for the MIPS and LoongArch CPUs, which would use cache after they jump into U-Boot. This commit requests the CPU to return the addresses in uncached windows and flushes the cache in need, to make sure the memory between the CPU and the network card is in consistency. Signed-off-by: Hanyuan Zhao <[email protected]>
2024-10-27net: dc2114x: set the card number to start at zeroHanyuan Zhao
Otherwise the number might get kind of weird. Signed-off-by: Hanyuan Zhao <[email protected]>
2024-10-27net: dc2114x: get mac address from environmentHanyuan Zhao
Let this old driver work like the other newer network card drivers, loading the MAC address from environment, which could be more flexible to set. Signed-off-by: Hanyuan Zhao <[email protected]>
2024-10-27net: dc2114x: add support for platforms that don't have pci controllersHanyuan Zhao
There're a few ethernet IP cores which have the same functions with dc2114x, and can be connected to CPU by AXI or other buses. This commit adds support for the platforms that do not have PCI controllers, using MMIO to communicate with the dc2114x IP core. Signed-off-by: Hanyuan Zhao <[email protected]>
2024-05-20Restore patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"Tom Rini
As part of bringing the master branch back in to next, we need to allow for all of these changes to exist here. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-19Revert "Merge patch series "arm: dts: am62-beagleplay: Fix Beagleplay Ethernet""Tom Rini
When bringing in the series 'arm: dts: am62-beagleplay: Fix Beagleplay Ethernet"' I failed to notice that b4 noticed it was based on next and so took that as the base commit and merged that part of next to master. This reverts commit c8ffd1356d42223cbb8c86280a083cc3c93e6426, reversing changes made to 2ee6f3a5f7550de3599faef9704e166e5dcace35. Reported-by: Jonas Karlman <[email protected]> Signed-off-by: Tom Rini <[email protected]>
2024-05-07net: Remove <common.h> and add needed includesTom Rini
Remove <common.h> from this driver directory and when needed add missing include files directly. Signed-off-by: Tom Rini <[email protected]>
2022-12-07net: dc2114x: Remove non-DM_ETH codeTom Rini
As DM_ETH is required for all network drivers, it's now safe to remove the non-DM_ETH support code. Signed-off-by: Tom Rini <[email protected]>
2020-12-13dm: treewide: Rename dev_get_platdata() to dev_get_plat()Simon Glass
Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass <[email protected]>
2020-12-13dm: treewide: Rename 'platdata' variables to just 'plat'Simon Glass
We use 'priv' for private data but often use 'platdata' for platform data. We can't really use 'pdata' since that is ambiguous (it could mean private or platform data). Rename some of the latter variables to end with 'plat' for consistency. Signed-off-by: Simon Glass <[email protected]>
2020-12-13dm: treewide: Rename auto_alloc_size members to be shorterSimon Glass
This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <[email protected]>
2020-07-25net: dc2114x: Add DM supportMarek Vasut
With all the changes in place, add support for DM into the dc2114x driver. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Split common parts of non-DM functions outMarek Vasut
Split the common code from the non-DM code, so it can be reused by the DM code later. As always, the recv() function had to be split into the actual receiving part and free_pkt part to fit with the DM. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Split RX pathMarek Vasut
Split the RX data check from the rest of the RX function, so that the check can be performed separately from the processing of the packet and the release of the received packet once the processing is finished. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Add RX/TX rings into the private dataMarek Vasut
The RX/TX DMA descriptor rings are per-device-instance private data, so move them into the private data. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Pass PCI BDF into phys_to_bus()Marek Vasut
This is a trick in preparation for adding DM support. By passing in the PCI BDF into the phys_to_bus() macros and calling that dev, we can substitute dev with udevice when DM support lands and do minor adjustment to the macros to support both DM and non-DM operation. No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Pass private data aroundMarek Vasut
This patch replaces the various uses of struct eth_device for accessing device private data with struct dc2114x_priv, which is compatible both with DM and non-DM operation. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Introduce private dataMarek Vasut
Introduce dc2114x_priv, which is a super-structure around eth_device and tracks per-device state and the device IO address. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Use standard I/O accessorsMarek Vasut
The current dc21x4x driver accesses its memory mapped registers directly instead of using the standard I/O accessors. This can cause problems on some systems as the accesses can get out of order. So convert the direct volatile dereferences to use the normal in/out macros. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Drop update_srom()Marek Vasut
This code is never used, remove it. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Support all DC2114xMarek Vasut
For the usage in this driver, the chips are identical, so support all of them. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-25net: dc2114x: Use PCI_DEVICE() to define PCI device compat listMarek Vasut
Use this macro to fully fill the PCI device ID table. This is mandatory for the DM PCI support, which checks all the fields. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]> Cc: Ramon Fried <[email protected]>
2020-07-17treewide: convert bd_t to struct bd_info by coccinelleMasahiro Yamada
The Linux coding style guide (Documentation/process/coding-style.rst) clearly says: It's a **mistake** to use typedef for structures and pointers. Besides, using typedef for structures is annoying when you try to make headers self-contained. Let's say you have the following function declaration in a header: void foo(bd_t *bd); This is not self-contained since bd_t is not defined. To tell the compiler what 'bd_t' is, you need to include <asm/u-boot.h> #include <asm/u-boot.h> void foo(bd_t *bd); Then, the include direcective pulls in more bloat needlessly. If you use 'struct bd_info' instead, it is enough to put a forward declaration as follows: struct bd_info; void foo(struct bd_info *bd); Right, typedef'ing bd_t is a mistake. I used coccinelle to generate this commit. The semantic patch that makes this change is as follows: <smpl> @@ typedef bd_t; @@ -bd_t +struct bd_info </smpl> Signed-off-by: Masahiro Yamada <[email protected]>
2020-05-18common: Drop linux/bitops.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <[email protected]>
2020-05-18common: Drop linux/delay.h from common headerSimon Glass
Move this uncommon header out of the common header. Signed-off-by: Simon Glass <[email protected]>
2020-05-01net: dc2114x: Switch DEBUG_SROM{,2} to debug_cond()Marek Vasut
Replace the adhoc debugging ifdeffery with debug_cond() and an internal SROM_DEBUG macro to select the debug level. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Reorganize driverMarek Vasut
Move the functions in the driver around to better fit future DM conversion, drop function forward declarations. No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up INL/OUTL functionsMarek Vasut
Rename these functions to dc2114x_{inl,outl}(), use u32 values in them instead of plain signed integers as all those values are in fact register values and the driver code does bitwise operations on them. No functional change intended. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up DE4X5 macrosMarek Vasut
Replace these macros with static functions to permit the compiler to do type checking on the functions. The INL()/OUTL() functions have to be moved in this patch as well, as those DE4X5 macros are using them. No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up remaining driver codeMarek Vasut
Clean up the remaining driver code, macro space alignment, function declaration indent, replace __attribute__((aligned(32))) with plain __aligned(32). No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up SROM operationsMarek Vasut
Clean up the SROM accessors to bring them up to standards with U-Boot coding style. Sort variable into reverse xmas tree. No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up send_setup_frame()Marek Vasut
Clean up the send_setup_frame() to bring it up to standards with U-Boot coding style, invert the loops where applicable to cut down the level of indent. No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up dc21x4x_halt()Marek Vasut
Clean up the driver halt code to bring it up to standards with U-Boot coding style. No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up dc21x4x_recv()Marek Vasut
Clean up the driver recv code to bring it up to standards with U-Boot coding style. No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up dc21x4x_send()Marek Vasut
Clean up the driver send code to bring it up to standards with U-Boot coding style, invert the loops where applicable to cut down the level of indent. No functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: dc2114x: Clean up init codeMarek Vasut
Clean up the driver init code to bring it up to standards with U-Boot coding style, no functional change. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2020-05-01net: tulip: Remove CONFIG_TULIP_*Marek Vasut
These macros are not used by any board, remove them to simplify the driver. The EEPROM accessors are still retained however, as those might still be useful. Signed-off-by: Marek Vasut <[email protected]> Cc: Joe Hershberger <[email protected]>
2019-08-11env: Move env_get() to env.hSimon Glass
Move env_get() over to the new header file. Acked-by: Joe Hershberger <[email protected]> Signed-off-by: Simon Glass <[email protected]>
2018-10-10net.h: Include linux/if_ether.h to avoid duplicationBin Meng
There are plenty of existing drivers that have macros like ETH_ALEN defined in their own source files. Now that we imported the kernel's if_ether.h to U-Boot we can reduce some duplication. Signed-off-by: Bin Meng <[email protected]> Acked-by: Joe Hershberger <[email protected]>
2018-05-07SPDX: Convert all of our single license tags to Linux Kernel styleTom Rini
When U-Boot started using SPDX tags we were among the early adopters and there weren't a lot of other examples to borrow from. So we picked the area of the file that usually had a full license text and replaced it with an appropriate SPDX-License-Identifier: entry. Since then, the Linux Kernel has adopted SPDX tags and they place it as the very first line in a file (except where shebangs are used, then it's second line) and with slightly different comment styles than us. In part due to community overlap, in part due to better tag visibility and in part for other minor reasons, switch over to that style. This commit changes all instances where we have a single declared license in the tag as both the before and after are identical in tag contents. There's also a few places where I found we did not have a tag and have introduced one. Signed-off-by: Tom Rini <[email protected]>
2017-08-16env: Rename eth_getenv_enetaddr() to eth_env_get_enetaddr()Simon Glass
Rename this function for consistency with env_get(). Signed-off-by: Simon Glass <[email protected]>
2015-04-18net: cosmetic: Fix var naming net <-> eth driversJoe Hershberger
Update the naming convention used in the network stack functions and variables that Ethernet drivers use to interact with it. This cleans up the temporary hacks that were added to this interface along with the DM support. This patch has a few remaining checkpatch.pl failures that would be out of the scope of this patch to fix (drivers that are in gross violation of checkpatch.pl). Signed-off-by: Joe Hershberger <[email protected]> Acked-by: Simon Glass <[email protected]>
2013-10-14Coding Style cleanup: remove trailing white spaceWolfgang Denk
Signed-off-by: Wolfgang Denk <[email protected]>
2013-07-24Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk
Signed-off-by: Wolfgang Denk <[email protected]> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <[email protected]>