Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[fdt] Add ability to parse a MAC address from a flattened device tree
The Raspberry Pi NIC has no EEPROM to hold the MAC address.  The
platform firmware (e.g. UEFI or U-Boot) will typically obtain the MAC
address from the VideoCore firmware and add it to the device tree,
which is then made available to subsequent programs such as iPXE or
the Linux kernel.

Add the ability to parse a flattened device tree and to extract the
MAC address.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
  • Loading branch information
mcb30 committed Jul 19, 2019
1 parent a385e23 commit e520a51
Show file tree
Hide file tree
Showing 5 changed files with 643 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/config/config_fdt.c
@@ -0,0 +1,38 @@
/*
* Copyright (C) 2019 Michael Brown <mbrown@fensystems.co.uk>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* You can also choose to distribute this program under the terms of
* the Unmodified Binary Distribution Licence (as given in the file
* COPYING.UBDL), provided that you have satisfied its requirements.
*/

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );

#include <config/fdt.h>

/** @file
*
* Flattened Device Tree configuration options
*
*/

PROVIDE_REQUIRING_SYMBOL();

/*
* Drag in devicetree sources
*/
16 changes: 16 additions & 0 deletions src/config/fdt.h
@@ -0,0 +1,16 @@
#ifndef CONFIG_FDT_H
#define CONFIG_FDT_H

/** @file
*
* Flattened Device Tree configuration
*
*/

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );

#include <config/defaults.h>

#include <config/local/fdt.h>

#endif /* CONFIG_FDT_H */

0 comments on commit e520a51

Please sign in to comment.