2010-12-11 07:18:49 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 B Labs Ltd,
|
|
|
|
* http://l4dev.org
|
|
|
|
* Author: Alexey Zaytsev <alexey.zaytsev@gmail.com>
|
|
|
|
*
|
|
|
|
* Based on mach-nomadik
|
|
|
|
* Copyright (C) 2009-2010 Jean-Christophe PLAGNIOL-VILLARD <plagnio@jcrosoft.com>
|
|
|
|
*
|
|
|
|
* 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; version 2 of
|
|
|
|
* the License.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <init.h>
|
|
|
|
#include <asm/armlinux.h>
|
2015-01-05 13:24:38 +00:00
|
|
|
#include <asm/system_info.h>
|
2010-12-11 07:18:49 +00:00
|
|
|
#include <generated/mach-types.h>
|
|
|
|
#include <mach/init.h>
|
|
|
|
#include <mach/platform.h>
|
|
|
|
#include <environment.h>
|
|
|
|
#include <partition.h>
|
2015-01-08 07:02:20 +00:00
|
|
|
#include <linux/sizes.h>
|
2016-04-12 07:59:51 +00:00
|
|
|
#include <platform_data/eth-smc91111.h>
|
2010-12-11 07:18:49 +00:00
|
|
|
|
|
|
|
static int vpb_console_init(void)
|
|
|
|
{
|
2015-01-05 13:24:38 +00:00
|
|
|
char *hostname = "versatilepb-unknown";
|
|
|
|
char *model = "ARM Versatile PB";
|
|
|
|
|
|
|
|
if (cpu_is_arm926()) {
|
|
|
|
hostname = "versatilepb-arm926";
|
|
|
|
model = "ARM Versatile PB (arm926)";
|
|
|
|
} else if (cpu_is_arm1176()) {
|
|
|
|
hostname = "versatilepb-arm1176";
|
|
|
|
model = "ARM Versatile PB (arm1176)";
|
|
|
|
}
|
|
|
|
|
|
|
|
barebox_set_hostname(hostname);
|
|
|
|
barebox_set_model(model);
|
2013-08-15 07:02:17 +00:00
|
|
|
|
2010-12-11 07:18:49 +00:00
|
|
|
versatile_register_uart(0);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
console_initcall(vpb_console_init);
|
|
|
|
|
2013-09-22 05:12:24 +00:00
|
|
|
static struct smc91c111_pdata net_pdata = {
|
|
|
|
.qemu_fixup = 1,
|
|
|
|
};
|
|
|
|
|
2011-07-29 09:43:48 +00:00
|
|
|
static int vpb_devices_init(void)
|
|
|
|
{
|
2012-08-11 14:19:19 +00:00
|
|
|
add_cfi_flash_device(DEVICE_ID_DYNAMIC, VERSATILE_FLASH_BASE, VERSATILE_FLASH_SIZE, 0);
|
2014-12-23 18:21:54 +00:00
|
|
|
devfs_add_partition("nor0", 0x00000, SZ_512K, DEVFS_PARTITION_FIXED, "self");
|
|
|
|
devfs_add_partition("nor0", SZ_512K, SZ_512K, DEVFS_PARTITION_FIXED, "env0");
|
2010-12-11 07:18:49 +00:00
|
|
|
|
2012-04-15 18:29:34 +00:00
|
|
|
add_generic_device("smc91c111", DEVICE_ID_DYNAMIC, NULL, VERSATILE_ETH_BASE,
|
2013-09-22 05:12:24 +00:00
|
|
|
64 * 1024, IORESOURCE_MEM, &net_pdata);
|
2010-12-11 07:18:49 +00:00
|
|
|
|
|
|
|
armlinux_set_architecture(MACH_TYPE_VERSATILE_PB);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
device_initcall(vpb_devices_init);
|