cpu: Add initial support for Allwinner A10 SoC
Add minimal support needed to get a bootblock capable of initialising a serial console. Change-Id: I50dd85544549baf9c5ea0aa3b4296972136c02a4 Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com> Reviewed-on: http://review.coreboot.org/4549 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks <dhendrix@chromium.org> Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
This commit is contained in:
30
src/cpu/allwinner/a10/pinmux.c
Normal file
30
src/cpu/allwinner/a10/pinmux.c
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Helpers to multiplex and configure pins on Allwinner SoCs
|
||||
*
|
||||
* Copyright (C) 2013 Alexandru Gagniuc <mr.nuke.me@gmail.com>
|
||||
* Subject to the GNU GPL v2, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include "gpio.h"
|
||||
|
||||
#include <arch/io.h>
|
||||
|
||||
static struct a10_gpio *const gpio = (void *)GPIO_BASE;
|
||||
|
||||
void gpio_set_func(u8 port, u8 pin, u8 pad_func)
|
||||
{
|
||||
u8 reg, bit;
|
||||
u32 reg32;
|
||||
|
||||
if ((port > GPS))
|
||||
return;
|
||||
|
||||
pin &= 0x1f;
|
||||
reg = pin / 8;
|
||||
bit = (pin % 8) * 4;
|
||||
|
||||
reg32 = read32(&gpio->port[port].cfg[reg]);
|
||||
reg32 &= ~(0xf << bit);
|
||||
reg32 |= (pad_func & 0xf) << bit;
|
||||
write32(reg32, &gpio->port[port].cfg[reg]);
|
||||
}
|
Reference in New Issue
Block a user