For example, the syntax for i2c_read is as follows: Because multiple devices share the same bus, the functions require information about both the chip address and the memory address within the chip. The functions i2c_read() and i2c_write() are used to receive and send data from the I2C bus. Finally, call i2c_set_bus_num() to reset the bus to its original number.Perform processing on this bus (sending and receiving data).Call i2c_set_bus_num() to set the bus for your current transaction.Store this bus number so that you can restore this state when you are finished with your transaction.Call i2c_get_bus_num() to obtain the current bus.For example, here are the functions for the Asix adapter: The usb_ether.h file also defines a set of three functions that must be implemented for each supported adapter. write_hwaddr() - writes the MAC address to the hardware from the ethaddr environment variable.įor USB Ethernet, the structure ueth_data in the file usb_ether.h describes the USB Ethernet driver.recv() - receives packets over the network.send() - sends packets over the network.halt() - shuts down the Ethernet device.You need to implement the following functions for the Ethernet driver: The board file calls the probe() function, which probes for Ethernet hardware, sets up the eth_device structure, and then calls eth_register(). The structure eth_device in the file net.h describes the Ethernet driver. To enable the USB-to-Ethernet connection, use the U-Boot command usb start.Īnother useful feature for development is that when you want to use an NFS root from the network, U-Boot can provide suitable boot arguments to the kernel on the Linux command line. If the device has a built-in port, Ethernet is detected when the board starts up and is available for use. Another way to provide Ethernet to a system is to connect a USB-to-Ethernet adapter to the USB port. Many x86 devices have a built-in Ethernet port.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |