ARM: rpi: only set usbethaddr on relevant systems

Model A and CM RPis don't have an on-board USB Ethernet device. Hence,
there's no point setting $usbethaddr based on the device fuses. Use the
model detection code to gate this. Note that the fuses are actually
programmed even on those devices though.

Signed-off-by: Stephen Warren <swarren@wwwdotorg.org>
This commit is contained in:
Stephen Warren 2014-12-05 20:56:46 -07:00 committed by Tom Rini
parent 03ca6a394a
commit 3207d8fc9c

View file

@ -82,58 +82,72 @@ struct msg_get_clock_rate {
static const struct { static const struct {
const char *name; const char *name;
const char *fdtfile; const char *fdtfile;
bool has_onboard_eth;
} models[] = { } models[] = {
[BCM2835_BOARD_REV_B_I2C0_2] = { [BCM2835_BOARD_REV_B_I2C0_2] = {
"Model B (no P5)", "Model B (no P5)",
"bcm2835-rpi-b-i2c0.dtb", "bcm2835-rpi-b-i2c0.dtb",
true,
}, },
[BCM2835_BOARD_REV_B_I2C0_3] = { [BCM2835_BOARD_REV_B_I2C0_3] = {
"Model B (no P5)", "Model B (no P5)",
"bcm2835-rpi-b-i2c0.dtb", "bcm2835-rpi-b-i2c0.dtb",
true,
}, },
[BCM2835_BOARD_REV_B_I2C1_4] = { [BCM2835_BOARD_REV_B_I2C1_4] = {
"Model B", "Model B",
"bcm2835-rpi-b.dtb", "bcm2835-rpi-b.dtb",
true,
}, },
[BCM2835_BOARD_REV_B_I2C1_5] = { [BCM2835_BOARD_REV_B_I2C1_5] = {
"Model B", "Model B",
"bcm2835-rpi-b.dtb", "bcm2835-rpi-b.dtb",
true,
}, },
[BCM2835_BOARD_REV_B_I2C1_6] = { [BCM2835_BOARD_REV_B_I2C1_6] = {
"Model B", "Model B",
"bcm2835-rpi-b.dtb", "bcm2835-rpi-b.dtb",
true,
}, },
[BCM2835_BOARD_REV_A_7] = { [BCM2835_BOARD_REV_A_7] = {
"Model A", "Model A",
"bcm2835-rpi-a.dtb", "bcm2835-rpi-a.dtb",
false,
}, },
[BCM2835_BOARD_REV_A_8] = { [BCM2835_BOARD_REV_A_8] = {
"Model A", "Model A",
"bcm2835-rpi-a.dtb", "bcm2835-rpi-a.dtb",
false,
}, },
[BCM2835_BOARD_REV_A_9] = { [BCM2835_BOARD_REV_A_9] = {
"Model A", "Model A",
"bcm2835-rpi-a.dtb", "bcm2835-rpi-a.dtb",
false,
}, },
[BCM2835_BOARD_REV_B_REV2_d] = { [BCM2835_BOARD_REV_B_REV2_d] = {
"Model B rev2", "Model B rev2",
"bcm2835-rpi-b-rev2.dtb", "bcm2835-rpi-b-rev2.dtb",
true,
}, },
[BCM2835_BOARD_REV_B_REV2_e] = { [BCM2835_BOARD_REV_B_REV2_e] = {
"Model B rev2", "Model B rev2",
"bcm2835-rpi-b-rev2.dtb", "bcm2835-rpi-b-rev2.dtb",
true,
}, },
[BCM2835_BOARD_REV_B_REV2_f] = { [BCM2835_BOARD_REV_B_REV2_f] = {
"Model B rev2", "Model B rev2",
"bcm2835-rpi-b-rev2.dtb", "bcm2835-rpi-b-rev2.dtb",
true,
}, },
[BCM2835_BOARD_REV_B_PLUS] = { [BCM2835_BOARD_REV_B_PLUS] = {
"Model B+", "Model B+",
"bcm2835-rpi-b-plus.dtb", "bcm2835-rpi-b-plus.dtb",
true,
}, },
[BCM2835_BOARD_REV_CM] = { [BCM2835_BOARD_REV_CM] = {
"Compute Module", "Compute Module",
"bcm2835-rpi-cm.dtb", "bcm2835-rpi-cm.dtb",
false,
}, },
}; };
@ -177,6 +191,9 @@ static void set_usbethaddr(void)
ALLOC_ALIGN_BUFFER(struct msg_get_mac_address, msg, 1, 16); ALLOC_ALIGN_BUFFER(struct msg_get_mac_address, msg, 1, 16);
int ret; int ret;
if (!models[rpi_board_rev].has_onboard_eth)
return;
if (getenv("usbethaddr")) if (getenv("usbethaddr"))
return; return;