-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds support for Cortina Systems Gemini family CPUs: http://www.cortina-systems.com/products/category/18 v3: - fixed __io(a) to be defined as __typesafe_io(a) v2: - #include <asm/io.h> -> <linux/io.h> - remove asm/system.h include - revorked mm.c to use named initializers - removed "empty" dma.h - updated copyrights Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
- Loading branch information
Paulius Zaleckas
committed
Mar 26, 2009
1 parent
6a915af
commit 59d3a19
Showing
21 changed files
with
1,033 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
if ARCH_GEMINI | ||
|
||
menu "Cortina Systems Gemini Implementations" | ||
|
||
endmenu | ||
|
||
config GEMINI_MEM_SWAP | ||
bool "Gemini memory is swapped" | ||
help | ||
Say Y here if Gemini memory is swapped by bootloader. | ||
|
||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# | ||
# Makefile for the linux kernel. | ||
# | ||
|
||
# Object file lists. | ||
|
||
obj-y := irq.o mm.o time.o devices.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ifeq ($(CONFIG_GEMINI_MEM_SWAP),y) | ||
zreladdr-y := 0x00008000 | ||
params_phys-y := 0x00000100 | ||
initrd_phys-y := 0x00800000 | ||
else | ||
zreladdr-y := 0x10008000 | ||
params_phys-y := 0x10000100 | ||
initrd_phys-y := 0x10800000 | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Common Gemini architecture functions | ||
* | ||
* Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
* | ||
* 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. | ||
*/ | ||
|
||
#ifndef __GEMINI_COMMON_H__ | ||
#define __GEMINI_COMMON_H__ | ||
|
||
struct mtd_partition; | ||
|
||
extern void gemini_map_io(void); | ||
extern void gemini_init_irq(void); | ||
extern void gemini_timer_init(void); | ||
|
||
/* Common platform devices registration functions */ | ||
extern int platform_register_uart(void); | ||
extern int platform_register_pflash(unsigned int size, | ||
struct mtd_partition *parts, | ||
unsigned int nr_parts); | ||
|
||
#endif /* __GEMINI_COMMON_H__ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Common devices definition for Gemini | ||
* | ||
* Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#include <linux/kernel.h> | ||
#include <linux/init.h> | ||
#include <linux/io.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/serial_8250.h> | ||
#include <linux/mtd/physmap.h> | ||
|
||
#include <mach/irqs.h> | ||
#include <mach/hardware.h> | ||
#include <mach/global_reg.h> | ||
|
||
static struct plat_serial8250_port serial_platform_data[] = { | ||
{ | ||
.membase = (void *)IO_ADDRESS(GEMINI_UART_BASE), | ||
.mapbase = GEMINI_UART_BASE, | ||
.irq = IRQ_UART, | ||
.uartclk = UART_CLK, | ||
.regshift = 2, | ||
.iotype = UPIO_MEM, | ||
.type = PORT_16550A, | ||
.flags = UPF_BOOT_AUTOCONF | UPF_SKIP_TEST | UPF_FIXED_TYPE, | ||
}, | ||
{}, | ||
}; | ||
|
||
static struct platform_device serial_device = { | ||
.name = "serial8250", | ||
.id = PLAT8250_DEV_PLATFORM, | ||
.dev = { | ||
.platform_data = serial_platform_data, | ||
}, | ||
}; | ||
|
||
int platform_register_uart(void) | ||
{ | ||
return platform_device_register(&serial_device); | ||
} | ||
|
||
static struct resource flash_resource = { | ||
.start = GEMINI_FLASH_BASE, | ||
.flags = IORESOURCE_MEM, | ||
}; | ||
|
||
static struct physmap_flash_data pflash_platform_data = {}; | ||
|
||
static struct platform_device pflash_device = { | ||
.name = "physmap-flash", | ||
.id = 0, | ||
.dev = { | ||
.platform_data = &pflash_platform_data, | ||
}, | ||
.resource = &flash_resource, | ||
.num_resources = 1, | ||
}; | ||
|
||
int platform_register_pflash(unsigned int size, struct mtd_partition *parts, | ||
unsigned int nr_parts) | ||
{ | ||
unsigned int reg; | ||
|
||
reg = __raw_readl(IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_STATUS); | ||
|
||
if ((reg & FLASH_TYPE_MASK) != FLASH_TYPE_PARALLEL) | ||
return -ENXIO; | ||
|
||
if (reg & FLASH_WIDTH_16BIT) | ||
pflash_platform_data.width = 2; | ||
else | ||
pflash_platform_data.width = 1; | ||
|
||
/* enable parallel flash pins and disable others */ | ||
reg = __raw_readl(IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_MISC_CTRL); | ||
reg &= ~PFLASH_PADS_DISABLE; | ||
reg |= SFLASH_PADS_DISABLE | NAND_PADS_DISABLE; | ||
__raw_writel(reg, IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_MISC_CTRL); | ||
|
||
flash_resource.end = flash_resource.start + size - 1; | ||
|
||
pflash_platform_data.parts = parts; | ||
pflash_platform_data.nr_parts = nr_parts; | ||
|
||
return platform_device_register(&pflash_device); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Debugging macro include header | ||
* | ||
* Copyright (C) 1994-1999 Russell King | ||
* Copyright (C) 2001-2006 Storlink, Corp. | ||
* Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
#include <mach/hardware.h> | ||
|
||
.macro addruart,rx | ||
mrc p15, 0, \rx, c1, c0 | ||
tst \rx, #1 @ MMU enabled? | ||
ldreq \rx, =GEMINI_UART_BASE @ physical | ||
ldrne \rx, =IO_ADDRESS(GEMINI_UART_BASE) @ virtual | ||
.endm | ||
|
||
#define UART_SHIFT 2 | ||
#define FLOW_CONTROL | ||
#include <asm/hardware/debug-8250.S> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Low-level IRQ helper macros for Gemini platform. | ||
* | ||
* Copyright (C) 2001-2006 Storlink, Corp. | ||
* Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
* | ||
* This file is licensed under the terms of the GNU General Public | ||
* License version 2. This program is licensed "as is" without any | ||
* warranty of any kind, whether express or implied. | ||
*/ | ||
#include <mach/hardware.h> | ||
|
||
#define IRQ_STATUS 0x14 | ||
|
||
.macro disable_fiq | ||
.endm | ||
|
||
.macro get_irqnr_preamble, base, tmp | ||
.endm | ||
|
||
.macro arch_ret_to_user, tmp1, tmp2 | ||
.endm | ||
|
||
.macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
ldr \irqstat, =IO_ADDRESS(GEMINI_INTERRUPT_BASE + IRQ_STATUS) | ||
ldr \irqnr, [\irqstat] | ||
cmp \irqnr, #0 | ||
beq 2313f | ||
mov \tmp, \irqnr | ||
mov \irqnr, #0 | ||
2312: | ||
tst \tmp, #1 | ||
bne 2313f | ||
add \irqnr, \irqnr, #1 | ||
mov \tmp, \tmp, lsr #1 | ||
cmp \irqnr, #31 | ||
bcc 2312b | ||
2313: | ||
.endm |
Oops, something went wrong.