mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-08-17 15:38:51 +09:00
![Neil Armstrong](/assets/img/avatar_default.png)
Add support for generating an unique MAC address using the SoC internal serial number from the Secure Monitor interface. The algorithm generates an unicast locally administered 6bytes minus 2bits address using an crc16 of the serial for the top 16bits with the lower 2 bits masked to setup the unicast locally administered property and a crc24 for the lower 24bits. Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
26 lines
569 B
C
26 lines
569 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Copyright (C) 2016 BayLibre, SAS
|
|
* Author: Neil Armstrong <narmstrong@baylibre.com>
|
|
*/
|
|
|
|
#ifndef __MESON_ETH_H__
|
|
#define __MESON_ETH_H__
|
|
|
|
#include <phy.h>
|
|
|
|
enum {
|
|
/* Use Internal RMII PHY */
|
|
MESON_USE_INTERNAL_RMII_PHY = 1,
|
|
};
|
|
|
|
/* Configure the Ethernet MAC with the requested interface mode
|
|
* with some optional flags.
|
|
*/
|
|
void meson_eth_init(phy_interface_t mode, unsigned int flags);
|
|
|
|
/* Generate an unique MAC address based on the HW serial */
|
|
int meson_generate_serial_ethaddr(void);
|
|
|
|
#endif /* __MESON_ETH_H__ */
|