9
0
Fork 0
barebox/arch/arm/boards/beaglebone/board.c

71 lines
1.8 KiB
C

/*
* (C) Copyright 2008
* Texas Instruments, <www.ti.com>
* Raghavendra KH <r-khandenahally@ti.com>
*
* Copyright (C) 2012 Jan Luebbe <j.luebbe@pengutronix.de>
*
* 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.
*/
/**
* @file
* @brief BeagleBone Specific Board Initialization routines
*/
#include <common.h>
#include <init.h>
#include <driver.h>
#include <envfs.h>
#include <environment.h>
#include <globalvar.h>
#include <sizes.h>
#include <net.h>
#include <bootsource.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>
#include <mach/am33xx-silicon.h>
#include <mach/sys_info.h>
#include <mach/syslib.h>
#include <mach/gpmc.h>
#include <linux/err.h>
#include "beaglebone.h"
static int beaglebone_devices_init(void)
{
int black;
if (!of_machine_is_compatible("ti,am335x-bone"))
return 0;
if (bootsource_get() == BOOTSOURCE_MMC) {
if (bootsource_get_instance() == 0)
omap_set_bootmmc_devname("mmc0");
else
omap_set_bootmmc_devname("mmc1");
}
am33xx_register_ethaddr(0, 0);
black = is_beaglebone_black();
globalvar_add_simple("board.variant", black ? "boneblack" : "bone");
printf("detected 'BeagleBone %s'\n", black ? "Black" : "White");
armlinux_set_bootparams((void *)0x80000100);
armlinux_set_architecture(MACH_TYPE_BEAGLEBONE);
return 0;
}
coredevice_initcall(beaglebone_devices_init);