summaryrefslogtreecommitdiffstats
path: root/src/drivers/net
Commit message (Collapse)AuthorAgeFilesLines
* drivers/net/ne2k: Remove some __SIMPLE_DEVICE__ useKyösti Mälkki2019-09-281-19/+12
| | | | | | | | | | | Note that the code assumes mainboard code to configure any PCI bridges prior to calling console_init(). Change-Id: I0312d359f153c02e4afcf1c09d79f9eb3019a8b2 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/35650 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
* src/{device,drivers}: Add missing 'include <types.h>'Elyes HAOUAS2019-05-292-0/+3
| | | | | | | | | | | <types.h> is supposed to provide <stdint.h> and <stddef.h>. So when <types.h> is included, <stdint.h> and/or <stddef.h> is removed. Change-Id: I3395715f9e2b03175089186ab2e57d9e508fc87c Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32806 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Lijian Zhao <lijian.zhao@intel.com>
* src: Use include <delay.h> when appropriateElyes HAOUAS2019-04-061-1/+0
| | | | | | | | | Change-Id: I23bc0191ca8fcd88364e5c08be7c90195019e399 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/32012 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: David Guckian
* src: Use 'include <string.h>' when appropriateElyes HAOUAS2019-03-202-2/+0
| | | | | | | | | | | | | Drop 'include <string.h>' when it is not used and add it when it is missing. Also extra lines removed, or added just before local includes. Change-Id: Iccac4dbaa2dd4144fc347af36ecfc9747da3de20 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31966 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Werner Zeh <werner.zeh@siemens.com> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
* coreboot: Replace all IS_ENABLED(CONFIG_XXX) with CONFIG(XXX)Julius Werner2019-03-081-4/+4
| | | | | | | | | | | | This patch is a raw application of find src/ -type f | xargs sed -i -e 's/IS_ENABLED\s*(CONFIG_/CONFIG(/g' Change-Id: I6262d6d5c23cabe23c242b4f38d446b74fe16b88 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://review.coreboot.org/c/coreboot/+/31774 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* device/mmio.h: Add include file for MMIO opsKyösti Mälkki2019-03-041-0/+1
| | | | | | | | | | | MMIO operations are arch-agnostic so the include path should not be arch/. Change-Id: I0fd70f5aeca02e98e96b980c3aca0819f5c44b98 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/31691 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* device/pci: Fix PCI accessor headersKyösti Mälkki2019-03-011-0/+1
| | | | | | | | | | | | | | PCI config accessors are no longer indirectly included from <arch/io.h> use <device/pci_ops.h> instead. Change-Id: I2adf46430a33bc52ef69d1bf7dca4655fc8475bd Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/31675 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* src/drivers: Remove needless '&' on function pointersElyes HAOUAS2019-01-231-2/+2
| | | | | | | | Change-Id: I7a99d0dcbc8ea1362a12a68fa519c49058d30a05 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/c/29868 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* buildsystem: Promote rules.h to default includeKyösti Mälkki2019-01-161-1/+0
| | | | | | | | | | Does not fix 3rdparty/, *.S or *.ld or yet. Change-Id: I66b48013dd89540b35ab219d2b64bc13f5f19cda Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/c/17656 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* src: Remove unneeded include <console/console.h>Elyes HAOUAS2018-11-161-1/+0
| | | | | | | | Change-Id: I40f8b4c7cbc55e16929b1f40d18bb5a9c19845da Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/29289 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* src: Add missing include <stdint.h>Elyes HAOUAS2018-11-011-0/+2
| | | | | | | | Change-Id: Idf10a09745756887a517da4c26db7a90a1bf9543 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/29403 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* src: Remove unneeded whitespaceElyes HAOUAS2018-10-231-1/+1
| | | | | | | | Change-Id: I6c77f4289b46646872731ef9c20dc115f0cf876d Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/29161 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
* drivers/net/atl1e: Add driverArthur Heymans2018-10-153-0/+206
| | | | | | | | | | | | | A shortcoming of this driver is that if multiple devices with the same PCI ID are present and don't have an eeprom, they would all get the same macadress set. The r8168 driver deals with such cases so it should be easy to implement if needed. Change-Id: I5c32df00e25453c350a45e7f1ee6834b89c4289f Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/28265 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
* src/drivers: Fix typoElyes HAOUAS2018-08-101-1/+1
| | | | | | | | Change-Id: I9144937b72a98517cbd41c093cff7bad543b4140 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/27916 Reviewed-by: Martin Roth <martinroth@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
* src: Use of device_t is deprecatedElyes HAOUAS2018-06-141-1/+5
| | | | | | | | Change-Id: I9cebfc5c77187bd81094031c43ff6df094908417 Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/27010 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* arch/x86: Drop leftover ROMCC console supportKyösti Mälkki2018-06-081-134/+13
| | | | | | | | Change-Id: I3e52569a34e1f7bfea8be9da91348c364ab705e1 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: https://review.coreboot.org/26817 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
* src/drivers: Get rid of whitespace before tabElyes HAOUAS2018-06-041-1/+1
| | | | | | | | Change-Id: Ia9ca055679c0332613afb2bb2ed86df165de3baf Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/26649 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* drivers/net: Check "ethernet_mac" when the device index is 1David Wu2018-05-151-3/+8
| | | | | | | | | | | | | | | | | | | | | | It is a special case for the Fizz firmware branch, when the device index is 1, it will check "ethernet_mac" first and then "ethernet_mac0". For single NIC: config.device_index = "1", maps to "ethernet_mac" For multiple NICs: config.device_index = "1", maps to "ethernet_mac0" BUG=b:77836343 BRANCH=Fizz TEST=Add device index in device tree && Program the mac address to VPD in shell vpd -s ethernet_mac=<mac address> or vpd -s ethernet-mac[0-9]=<mac address> && reboot the system. Ensure the MAC address was fetched correctly by ifconfig command. Change-Id: I67fd2e999c8f9d8782f294fcafa84b8da970a3a6 Signed-off-by: David Wu <david_wu@quantatw.com> Reviewed-on: https://review.coreboot.org/26051 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* drivers/net: Add device index for multiple NIC cardsGaggery Tsai2018-01-222-9/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a member device_index to r8168 chip information which allows driver to identify which NIC card requests MAC address. In this implementation, only 10 NIC cards are supported, the device index is in the range of 0 to 10. Regarding to MAC address mapping, when there is only one NIC on DUT, it is treated as a special case mapping to "ethernet_mac" in VPD for backward compatibility. When there are multiple NICs on DUT, they are mapping to "ethernet_macN" where N is [0-9]. Device tree configuration: For single NIC: .device_index = "0", maps to "ethernet_mac" For multiple NICs: .device_index = "[1-10]", maps to "ethernet_mac[device_index - 1]" BUG=b:69950854 BRANCH=None TEST=Added device_index = [0-10] under /drivers/net in device tree && Programmed the mac address to VPD in shell vpd -s ethernet_mac=<mac address> or vpd -s ethernet-mac[0-9]=<mac address> && reboot the system. Ensure the MAC address was fetched correctly by ifconfig command. Change-Id: I108b9bfba39370c8906a2fa4d2b39b106e884e0c Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com> Reviewed-on: https://review.coreboot.org/22984 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
* drivers/net: add SSDT ACPI declaration and WOL featureGaggery Tsai2017-11-272-0/+53
| | | | | | | | | | | | | | | | | | | | | This patch adds SSDT ACPI generator and declares _UID, _HID, _DDN and also _PRW for WOL feature. Besides, adds a wake variable in chip information. BUG=b:69290148 BRANCH=None TEST=Add register "wake" = "GPE0_PCI_EXP" in devicetree under r8168 chip driver && dump SSDT to make sure _UID, _HID, _DDN and _PRW are filled correctly && put system into S3 && sudo etherwake -i eth0 $MAC to make sure the system could be woken up by WOL package. Change-Id: Ibc9115e8a08ba2bfcb3ee1e34c73cf1976a6ba2d Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com> Reviewed-on: https://review.coreboot.org/22480 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Duncan Laurie <dlaurie@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
* drivers/net/r8168: Add customized LED modeGaggery Tsai2017-11-013-4/+75
| | | | | | | | | | | | | | | | | | | | | This patch adds a function to program a customized LED setting for Realtek 81xx family. It reads the settings from devicetree under target board and programs the setting to offset 0x18 and 0x19. BUG=b:65437780 TEST=Add customized_leds register in devicetree.cb under target board, enable RT8168_SET_LED_MODE flag. Make sure the setting is programmed correctly to offset 0x18 and 0x19. Observed the LEDs were behaving as expected. Executed suspend/resume and the LEDs were still working as expected. Change-Id: Ib3d4f2cd98ac391e1661a891d604bdd1974d07f6 Signed-off-by: Gaggery Tsai <gaggery.tsai@intel.com> Reviewed-on: https://review.coreboot.org/21862 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-by: Furquan Shaikh <furquan@google.com>
* src/drivers: Fix checkpatch warning: no spaces at the start of a lineMartin Roth2017-07-282-11/+11
| | | | | | | | | | | | This excludes files which are mostly spaces, which I felt should be handled separately. Change-Id: I33043a3090e2fc6e9d2fd81e8a5e46fb6cb0aa35 Signed-off-by: Martin Roth <martinroth@google.com> Reviewed-on: https://review.coreboot.org/20731 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
* drivers/net/r8168: Get mac address from VPDShelley Chen2017-06-202-20/+108
| | | | | | | | | | | | | | | | | | | | | | | If RT8168_GET_MAC_FROM_VPD selected, use r8168 driver with some slight mods to check the VPD for a mac address. Otherwise, check for mac address in cbfs. Use default mac address if cannot find one. BUG=b:62090148, b:35775024 BRANCH=None TEST=Boot to kernel. Insert mac address into VPD vpd -s ethernet_mac=<address> reboot the system. Ensure we have ip address and corresponding mac address with ifconfig. Ensure ethernet controller shows up with lspci. Change-Id: I7ff29de2c4c3635dc786686cc071c68d51b0f975 Signed-off-by: Shelley Chen <shchen@chromium.org> Reviewed-on: https://review.coreboot.org/20008 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
* drivers/net/rt8168: Add a macaddress cbfsfile using KconfigArthur Heymans2017-01-263-3/+23
| | | | | | | | | | | | | | | The default macaddress in rt8168.c can be changed with a cbfsfile called macaddress. This patch makes it possible to add such a file using Kconfig at build time. This also changes the name of the cbfsfile from "macaddress" to "rt8168-macaddress" to avoid confusion. Change-Id: I24674d8df11845167b837b79344427ce0c67f4fb Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/18088 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
* drivers/r8168: Read default MAC address from CBFSDamien Zammit2016-12-081-26/+93
| | | | | | | | | | | | | | | | | | | | This driver applies to 10ec:8168 Previously, this driver resetted the nic and set a hardcoded MAC address. Now the driver reads a default MAC address from CBFS in the form of a string: echo -n "xx:xx:xx:xx:xx:xx" > macaddress and store the macaddress file in CBFS with the same name. TESTED on GA-G41M-ES2L and GA-945GCM-S2L: MAC address was detected Change-Id: If1af91120fa3efca3f1406334a83ed1e59fbdaf9 Signed-off-by: Damien Zammit <damien@zamaudio.com> Reviewed-on: https://review.coreboot.org/17672 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
* drivers/net/Kconfig: Hide REALTEK_8168_RESET in menuconfigArthur Heymans2016-11-241-1/+1
| | | | | | | | | | | Resetting a Realtek 8168 NIC only makes sense on targets that have such a device. Change-Id: I8ac9e8da1d8ecaacb19b4610a9b75f107915d691 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/17577 Tested-by: build bot (Jenkins) Reviewed-by: Nico Huber <nico.h@gmx.de>
* net/r8167: do net set bus msater enableRonald G. Minnich2016-11-211-3/+3
| | | | | | | | | | | | | | | It's very dangerous to set bus master enable, and more so on a NIC, where random broadcast packets can end up in memory in unexpected ways. If your kernel has trouble with the fact that we do not set bus master enable, you need to fix your kernel. Change-Id: If07fde7961ad80125567240cb43db036346bef97 Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Reviewed-on: https://review.coreboot.org/17559 Reviewed-by: Timothy Pearson <tpearson@raptorengineering.com> Tested-by: build bot (Jenkins)
* src/drivers: Add required space before opening parenthesis '('Elyes HAOUAS2016-08-311-1/+1
| | | | | | | | Change-Id: I4d0087b2557862d04be54cf42f01b3223cb723ac Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr> Reviewed-on: https://review.coreboot.org/16321 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
* drivers/net/r8168: Add driver for realtek nicDamien Zammit2016-05-313-0/+100
| | | | | | | | | | | | | One thing that is vital to this patch is the MAC address setting in case the EEPROM/efuse is unconfigured. Linux now recognises the default MAC address on GA-G41M-ES2L which does rely on the default bios settings for the MAC address. Change-Id: I32e070b545b4c6369686a7087b7ff838d00764e3 Signed-off-by: Damien Zammit <damien@zamaudio.com> Reviewed-on: https://review.coreboot.org/14927 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth <martinroth@google.com>
* drivers/net/ne2k.c: Fix regressionEdward O'Callaghan2014-11-221-1/+1
| | | | | | | | | | | Provide dummy ramstage symbol to keep the linker happy. Borked in commit fd95624 Change-Id: I2c49e82fec8eb936390cc3b30698f1bf73968c99 Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/7548 Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Tested-by: build bot (Jenkins)
* drivers/net/ne2k.c: Collect headers and defines to top of fileEdward O'Callaghan2014-11-071-17/+17
| | | | | | | | Change-Id: I2ffb0dd9fe400132f6d430f115f962b5f8578efa Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/7292 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi <pgeorgi@google.com>
* drivers: Trivial - drop trailing blank lines at EOFEdward O'Callaghan2014-07-081-1/+0
| | | | | | | | Change-Id: Ie80c87c614a536cc6b0bdbf196c280b64547d3b7 Signed-off-by: Edward O'Callaghan <eocallaghan@alterapraxis.com> Reviewed-on: http://review.coreboot.org/6203 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
* ne2k: Move under drivers/netKyösti Mälkki2014-02-063-0/+570
Change-Id: I978b6009c09c31be4429f57be40ef82f438f7574 Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/5135 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>