From 33f59d8a81b4f870239b79ef274609b964292f84 Mon Sep 17 00:00:00 2001 From: Carlo Caione Date: Thu, 18 Oct 2012 21:42:43 +0200 Subject: Raspberry-Pi: add support (board) Tested-By: Jan Luebbe Signed-off-by: Carlo Caione Signed-off-by: Sascha Hauer --- arch/arm/boards/raspberry-pi/Makefile | 1 + arch/arm/boards/raspberry-pi/config.h | 4 ++ .../arm/boards/raspberry-pi/env/init/bootargs-base | 8 ++++ arch/arm/boards/raspberry-pi/env/init/hostname | 8 ++++ arch/arm/boards/raspberry-pi/rpi.c | 44 ++++++++++++++++++++++ 5 files changed, 65 insertions(+) create mode 100644 arch/arm/boards/raspberry-pi/Makefile create mode 100644 arch/arm/boards/raspberry-pi/config.h create mode 100644 arch/arm/boards/raspberry-pi/env/init/bootargs-base create mode 100644 arch/arm/boards/raspberry-pi/env/init/hostname create mode 100644 arch/arm/boards/raspberry-pi/rpi.c (limited to 'arch/arm/boards/raspberry-pi') diff --git a/arch/arm/boards/raspberry-pi/Makefile b/arch/arm/boards/raspberry-pi/Makefile new file mode 100644 index 0000000000..6ce5edeb27 --- /dev/null +++ b/arch/arm/boards/raspberry-pi/Makefile @@ -0,0 +1 @@ +obj-$(CONFIG_MACH_RPI) += rpi.o diff --git a/arch/arm/boards/raspberry-pi/config.h b/arch/arm/boards/raspberry-pi/config.h new file mode 100644 index 0000000000..ca15136817 --- /dev/null +++ b/arch/arm/boards/raspberry-pi/config.h @@ -0,0 +1,4 @@ +#ifndef __CONFIG_H +#define __CONFIG_H + +#endif /* __CONFIG_H */ diff --git a/arch/arm/boards/raspberry-pi/env/init/bootargs-base b/arch/arm/boards/raspberry-pi/env/init/bootargs-base new file mode 100644 index 0000000000..d86975406e --- /dev/null +++ b/arch/arm/boards/raspberry-pi/env/init/bootargs-base @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "Base bootargs" + exit +fi + +global.linux.bootargs.base="console=ttymxc0,115200" diff --git a/arch/arm/boards/raspberry-pi/env/init/hostname b/arch/arm/boards/raspberry-pi/env/init/hostname new file mode 100644 index 0000000000..7e8f294357 --- /dev/null +++ b/arch/arm/boards/raspberry-pi/env/init/hostname @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ "$1" = menu ]; then + init-menu-add-entry "$0" "hostname" + exit +fi + +global.hostname=Raspberry-Pi diff --git a/arch/arm/boards/raspberry-pi/rpi.c b/arch/arm/boards/raspberry-pi/rpi.c new file mode 100644 index 0000000000..3be95ae5c4 --- /dev/null +++ b/arch/arm/boards/raspberry-pi/rpi.c @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2009 Carlo Caione + * + * 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. + * + */ + +#include +#include +#include +#include + +#include + +static int rpi_mem_init(void) +{ + bcm2835_add_device_sdram(0); + return 0; +} +mem_initcall(rpi_mem_init); + +static int rpi_console_init(void) +{ + bcm2835_register_uart(); + return 0; +} +console_initcall(rpi_console_init); + +static int rpi_devices_init(void) +{ + armlinux_set_architecture(MACH_TYPE_BCM2708); + armlinux_set_bootparams((void *)(0x00000100)); + return 0; +} + +device_initcall(rpi_devices_init); -- cgit v1.2.3