aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-06-18net: pcnet: Split common and non-DM functionsMarek Vasut1-55/+94
Pull the common parts of functions out so they can be reused by both DM and non-DM code paths. The recv() function had to be reworked to fit into this scheme and this means it now only receives one packet at a time instead of spinning in an endless loop. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Wrap name and enetaddr into private dataMarek Vasut1-15/+19
Instead of using the non-DM-only name and enetaddr in struct eth_device, add pointers into the private data which can either point to that non-DM name or a DM one later on. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Wrap iobase into private dataMarek Vasut1-57/+46
Instead of using the non-DM-only iobase in struct eth_device, add one into the private data to make DM and non-DM operation possible. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Pass private data through dev->privMarek Vasut1-10/+10
Get rid of the global point to private data, and rather pass it thought dev->priv. Also remove the unnecessary check for lp being non-NULL, since it is always NULL at this point. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Wrap devbusfn into private dataMarek Vasut1-10/+9
Instead of using eth_device priv for this PCI devbusfn, free it so it could be used for driver private data, and wrap devbusfn into those driver private data. Note that using the name dev for the variable is a trick left for later, when DM support is in place, so dm_pci_virt_to_mem() can be used with minimal ifdeffery. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Drop useless forward declarationsMarek Vasut1-6/+0
Remove those as they are not needed anymore. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Move initialize function at the endMarek Vasut1-91/+89
Move the function at the end of the driver, so we could drop various forward declarations later. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Move private data allocation to initializeMarek Vasut1-13/+14
The private data allocation does not have to be done every time the NIC is initialized at run time, move the allocation to initialize function, which means it will be done only once when the driver starts. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Replace memset+malloc with callocMarek Vasut1-2/+1
This combination of functions can be replaced with calloc(), make it so. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Simplify private data allocationMarek Vasut1-21/+12
The current code is horribly complex. Both the RX and TX buffer descriptors are 16 bytes in size, the init block is 32 bytes in size, so simplify the code such that the entire private data of the driver are allocated cache aligned and the RX and TX buffer descriptors are part of the private data. This removes multiple malloc calls and cache flushes. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Use PCI_DEVICE() to define PCI device compat listMarek Vasut1-1/+1
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 <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Drop PCNET_HAS_PROMMarek Vasut2-6/+0
All of one PCNET users has this option set, make this default and drop this config option. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: pcnet: Drop typedef struct pcnet_priv_tMarek Vasut1-5/+5
Use struct pcnet_priv all over the place instead. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Daniel Schwierzeck <daniel.schwierzeck@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-18net: eepro100: Add Kconfig entriesMarek Vasut33-29/+12
Add Kconfig entries for the eepro100 driver and convert various boards. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Add DM supportMarek Vasut1-1/+128
Add support for driver model to the driver. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Split common parts of non-DM functions outMarek Vasut1-62/+100
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 <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Drop bd_t pointer from read_hw_addr()Marek Vasut1-2/+2
The pointer is unused, so drop it. Rename the function to start with the eepro100_ prefix. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Add RX/TX rings into the private dataMarek Vasut1-24/+35
The RX/TX DMA descriptor rings are per-device-instance private data, so move them into the private data. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Pass device private data into mdiobusMarek Vasut1-6/+3
Instead of doing ethernet device lookup by name every time there is an MDIO access, pass the driver private data via mdiobus priv to the MDIO bus accessors. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Pass device private data aroundMarek Vasut1-124/+140
This patch replaces the various uses of struct eth_device for accessing device private data with struct eepro100_priv, which is compatible both with DM and non-DM operation. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Introduce device private dataMarek Vasut1-3/+9
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Pass PCI BDF into bus_to_phys()/phys_to_bus()Marek Vasut1-14/+22
This is a trick in preparation for adding DM support. By passing in the PCI BDF into the bus_to_phys()/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 <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Drop inline keywordMarek Vasut1-4/+4
Drop the inline keyword from the static functions, the compiler has a much better overview and can decide how to inline those functions much better. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Fix EE_*_CMD macrosMarek Vasut1-5/+5
Those macros depended on specific variable names to be declared at their usage sites, fix this by adding an argument to those macros and also protect the argument with braces. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Factor out MII registrationMarek Vasut1-17/+39
Pull the MII registration code into a separate function. Moreover, properly free memory in case any of the registration or allocation functions fail, so this fixes an existing memleak. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Switch from malloc()+memset() to calloc()Marek Vasut1-2/+1
Replace malloc()+memset() combination with calloc(), no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Use PCI_DEVICE() to define PCI device compat listMarek Vasut1-4/+4
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 <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Reorder functions in the driverMarek Vasut1-170/+160
Move the functions around in the driver to prepare it for DM conversion. Drop forward declarations which are not necessary anymore. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Remove volatile misuseMarek Vasut1-21/+21
Remove all the remaining use of the 'volatile' keyword, as this is no longer required. All the accesses which might have needed this use of 'volatile' have been repaired properly. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Add cache managementMarek Vasut1-20/+45
Add cache invalidation and flushes wherever the DMA descriptors are written or read, otherwise this driver cannot work reliably on any systems where caches are enabled. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Factor out tx_ring command issuingMarek Vasut1-71/+53
This code is replicated in the driver thrice almost verbatim, factor it out into a separate function and clean it up. No functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Replace purge_tx_ring() with memset()Marek Vasut1-15/+1
This function zeroes-out all the descriptors in the TX ring, use memset() instead. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Use standard I/O accessorsMarek Vasut1-4/+4
The current eepro100 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 <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Fix camelcaseMarek Vasut1-87/+85
This is automated cleanup via checkpatch, no functional change. ./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c ./scripts/checkpatch.pl --types INDENTED_LABEL -f --fix --fix-inplace drivers/net/eepro100.c Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Fix remaining checkpatch issuesMarek Vasut1-21/+24
This is automated cleanup via checkpatch, no functional change. ./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c ./scripts/checkpatch.pl -f --fix --fix-inplace drivers/net/eepro100.c This fixes all the remaining errors except a couple of comments which are longer than 80 characters, all the volatile misuse and all the camelcase, that needs a separate patch. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Fix indented labelMarek Vasut1-4/+4
This is automated cleanup via checkpatch, no functional change. ./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c ./scripts/checkpatch.pl --types INDENTED_LABEL -f --fix --fix-inplace drivers/net/eepro100.c Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Fix pointer locationMarek Vasut1-6/+6
This is automated cleanup via checkpatch, no functional change. ./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c ./scripts/checkpatch.pl --types POINTER_LOCATION -f --fix --fix-inplace drivers/net/eepro100.c Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Fix parenthesis alignmentMarek Vasut1-10/+10
This is automated cleanup via checkpatch, no functional change. ./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c ./scripts/checkpatch.pl --types PARENTHESIS_ALIGNMENT -f --fix --fix-inplace drivers/net/eepro100.c Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Fix bracesMarek Vasut1-7/+4
This is automated cleanup via checkpatch, no functional change. ./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c ./scripts/checkpatch.pl --types BRACES -f --fix --fix-inplace drivers/net/eepro100.c Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Fix spacingMarek Vasut1-139/+139
This is automated cleanup via checkpatch, no functional change. ./scripts/checkpatch.pl --show-types -f drivers/net/eepro100.c ./scripts/checkpatch.pl --types SPACING -f --fix --fix-inplace drivers/net/eepro100.c Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Use plain debug()Marek Vasut1-11/+4
Convert all the ifdef DEBUG to plain debug(), no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Clean up commentsMarek Vasut1-64/+36
Clean the comments up to they trigger fewer checkpatch warnings, no functional change. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-18net: eepro100: Remove EEPRO100_SROM_WRITEMarek Vasut3-90/+0
This code is never enabled, last board that used it was ELPPC which was removed some 5 years ago, so just remove this code altogether. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
2020-06-16common: hash: Remove a debug printf statementHarald Seiler1-2/+0
Remove a left-over debug printf that was introduced with SHA512 support. Fixes: d16b38f42704 ("Add support for SHA384 and SHA512") Signed-off-by: Harald Seiler <hws@denx.de>
2020-06-13Merge tag 'dm-pull-12jun20' of git://git.denx.de/u-boot-dm into nextTom Rini41-207/+691
patman improvements to allow it to work with Zephyr change to how sequence numbers are assigned to devices minor fixes and improvements
2020-06-12Merge branch '2020-06-12-next-net' into nextTom Rini33-693/+892
- Merge tbs2910 distro boot support and associated clean-ups and size reduction. - Assorted networking corrections / bugfixes. - Drop smc911x standalone API example as it was likely non-functional for a long time. - Enhanced support for TI PHYs - rtl8139 DM conversion
2020-06-12net: move random_port() to dnsBaruch Siach3-17/+10
The random_port() routine is not used anywhere else. Make it local to dns.c to reduce code clutter, and shrink generated code a little. Signed-off-by: Baruch Siach <baruch@tkos.co.il>
2020-06-12net: tftp: fix option validation as per RFCsRavik Hasija1-7/+52
RFC2348, RFC2349: - Option string is case in-sensitive. - Client must generate ERR pkt in case option value mismatch in server OACK - Fix debug print for options Signed-off-by: Ravik Hasija <rahasij@linux.microsoft.com> Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
2020-06-12net: rtl8139: Add DM supportMarek Vasut1-1/+132
Add support for driver model to the driver. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>
2020-06-12net: rtl8139: Read HW address from EEPROM only on probeMarek Vasut1-9/+18
Do not re-read the HW address from the EEPROM on every start of transfer, otherwise the user will not be able to adjust ethaddr as needed. Read the address only once, when the card is detected. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Joe Hershberger <joe.hershberger@ni.com>