Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a2e0d624 authored by Kukjin Kim's avatar Kukjin Kim
Browse files

ARM: S5P64X0: Add S5P64X0(S5P6440 and S5P6450) initialization support



This patch adds ARCH_S5P64X0 which can support S5P6440 and S5P6450 with
one kernel image. So moved some files of mach-s5p6440 into the new ARCH
directory mach-s5p64x0.

Signed-off-by: default avatarKukjin Kim <kgene.kim@samsung.com>
parent 49b7a491
Loading
Loading
Loading
Loading
+0 −81
Original line number Diff line number Diff line
/* linux/arch/arm/mach-s5p6440/include/mach/map.h
 *
 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 *
 * S5P6440 - Memory map definitions
 *
 * 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.
*/

#ifndef __ASM_ARCH_MAP_H
#define __ASM_ARCH_MAP_H __FILE__

#include <plat/map-base.h>
#include <plat/map-s5p.h>

#define S5P6440_PA_CHIPID	(0xE0000000)
#define S5P_PA_CHIPID		S5P6440_PA_CHIPID

#define S5P6440_PA_SYSCON	(0xE0100000)
#define S5P6440_PA_CLK		(S5P6440_PA_SYSCON + 0x0)
#define S5P_PA_SYSCON		S5P6440_PA_SYSCON

#define S5P6440_PA_GPIO		(0xE0308000)

#define S5P6440_PA_VIC0		(0xE4000000)
#define S5P6440_PA_VIC1		(0xE4100000)

#define S5P6440_PA_PDMA		0xE9000000

#define S5P6440_PA_TIMER	(0xEA000000)
#define S5P_PA_TIMER		S5P6440_PA_TIMER

#define S5P6440_PA_RTC		(0xEA100000)

#define S5P6440_PA_WDT		(0xEA200000)

#define S5P6440_PA_UART		(0xEC000000)

#define S5P_PA_UART0		(S5P6440_PA_UART + 0x0)
#define S5P_PA_UART1		(S5P6440_PA_UART + 0x400)
#define S5P_PA_UART2		(S5P6440_PA_UART + 0x800)
#define S5P_PA_UART3		(S5P6440_PA_UART + 0xC00)

#define S5P_SZ_UART		SZ_256

#define S5P6440_PA_IIC0		(0xEC104000)
#define S5P6440_PA_IIC1		(0xEC20F000)

#define S5P6440_PA_SPI0		0xEC400000
#define S5P6440_PA_SPI1		0xEC500000

#define S5P6440_PA_HSOTG	(0xED100000)

#define S5P6440_PA_HSMMC0	(0xED800000)
#define S5P6440_PA_HSMMC1	(0xED900000)
#define S5P6440_PA_HSMMC2	(0xEDA00000)

#define S5P6440_PA_SDRAM	(0x20000000)
#define S5P_PA_SDRAM		S5P6440_PA_SDRAM

/* I2S */
#define S5P6440_PA_I2S		0xF2000000

/* PCM */
#define S5P6440_PA_PCM		0xF2100000

#define S5P6440_PA_ADC		(0xF3000000)

/* compatibiltiy defines. */
#define S3C_PA_UART		S5P6440_PA_UART
#define S3C_PA_IIC		S5P6440_PA_IIC0
#define S3C_PA_RTC		S5P6440_PA_RTC
#define S3C_PA_IIC1		S5P6440_PA_IIC1
#define S3C_PA_WDT		S5P6440_PA_WDT

#define SAMSUNG_PA_ADC		S5P6440_PA_ADC

#endif /* __ASM_ARCH_MAP_H */
+0 −24
Original line number Diff line number Diff line
/* linux/arch/arm/mach-s5p6440/include/mach/uncompress.h
 *
 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 *
 * S5P6440 - uncompress code
 *
 * 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.
*/

#ifndef __ASM_ARCH_UNCOMPRESS_H
#define __ASM_ARCH_UNCOMPRESS_H

#include <mach/map.h>
#include <plat/uncompress.h>

static void arch_detect_cpu(void)
{
	/* we do not need to do any cpu detection here at the moment. */
}

#endif /* __ASM_ARCH_UNCOMPRESS_H */
+208 −0
Original line number Diff line number Diff line
/* linux/arch/arm/mach-s5p6440/cpu.c
/* linux/arch/arm/mach-s5p64x0/cpu.c
 *
 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com
@@ -19,62 +19,78 @@
#include <linux/sysdev.h>
#include <linux/serial_core.h>
#include <linux/platform_device.h>
#include <linux/sched.h>

#include <asm/mach/arch.h>
#include <asm/mach/map.h>
#include <asm/mach/irq.h>

#include <asm/proc-fns.h>
#include <asm/irq.h>

#include <mach/hardware.h>
#include <mach/map.h>
#include <asm/irq.h>

#include <plat/regs-serial.h>
#include <mach/regs-clock.h>

#include <plat/regs-serial.h>
#include <plat/cpu.h>
#include <plat/devs.h>
#include <plat/clock.h>
#include <plat/s5p6440.h>
#include <plat/s5p6450.h>
#include <plat/adc-core.h>

/* Initial IO mappings */

static struct map_desc s5p6440_iodesc[] __initdata = {
static struct map_desc s5p64x0_iodesc[] __initdata = {
	{
		.virtual	= (unsigned long)S5P_VA_GPIO,
		.pfn		= __phys_to_pfn(S5P6440_PA_GPIO),
		.pfn		= __phys_to_pfn(S5P64X0_PA_GPIO),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)VA_VIC0,
		.pfn		= __phys_to_pfn(S5P6440_PA_VIC0),
		.pfn		= __phys_to_pfn(S5P64X0_PA_VIC0),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	}, {
		.virtual	= (unsigned long)VA_VIC1,
		.pfn		= __phys_to_pfn(S5P6440_PA_VIC1),
		.pfn		= __phys_to_pfn(S5P64X0_PA_VIC1),
		.length		= SZ_16K,
		.type		= MT_DEVICE,
	}, {
	},
};

static struct map_desc s5p6440_iodesc[] __initdata = {
	{
		.virtual	= (unsigned long)S3C_VA_UART,
		.pfn		= __phys_to_pfn(S5P6440_PA_UART(0)),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
};

static struct map_desc s5p6450_iodesc[] __initdata = {
	{
		.virtual	= (unsigned long)S3C_VA_UART,
		.pfn		= __phys_to_pfn(S3C_PA_UART),
		.pfn		= __phys_to_pfn(S5P6450_PA_UART(0)),
		.length		= SZ_512K,
		.type		= MT_DEVICE,
	}
	}, {
		.virtual	= (unsigned long)S3C_VA_UART + SZ_512K,
		.pfn		= __phys_to_pfn(S5P6450_PA_UART(5)),
		.length		= SZ_4K,
		.type		= MT_DEVICE,
	},
};

static void s5p6440_idle(void)
static void s5p64x0_idle(void)
{
	unsigned long val;

	if (!need_resched()) {
		val = __raw_readl(S5P_PWR_CFG);
		val = __raw_readl(S5P64X0_PWR_CFG);
		val &= ~(0x3 << 5);
		val |= (0x1 << 5);
		__raw_writel(val, S5P_PWR_CFG);
		__raw_writel(val, S5P64X0_PWR_CFG);

		cpu_do_idle();
	}
@@ -82,19 +98,35 @@ static void s5p6440_idle(void)
}

/*
 * s5p6440_map_io
 * s5p64x0_map_io
 *
 * register the standard cpu IO areas
 * register the standard CPU IO areas
 */

void __init s5p6440_map_io(void)
{
	/* initialize any device information early */
	s3c_adc_setname("s3c64xx-adc");
	s3c_adc_setname("s3c64x0-adc");

	iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
	iotable_init(s5p6440_iodesc, ARRAY_SIZE(s5p6440_iodesc));
}

void __init s5p6450_map_io(void)
{
	/* initialize any device information early */
	s3c_adc_setname("s3c64x0-adc");

	iotable_init(s5p64x0_iodesc, ARRAY_SIZE(s5p64x0_iodesc));
	iotable_init(s5p6450_iodesc, ARRAY_SIZE(s5p6440_iodesc));
}

/*
 * s5p64x0_init_clocks
 *
 * register and setup the CPU clocks
 */

void __init s5p6440_init_clocks(int xtal)
{
	printk(KERN_DEBUG "%s: initializing clocks\n", __func__);
@@ -105,9 +137,25 @@ void __init s5p6440_init_clocks(int xtal)
	s5p6440_setup_clocks();
}

void __init s5p6450_init_clocks(int xtal)
{
	printk(KERN_DEBUG "%s: initializing clocks\n", __func__);

	s3c24xx_register_baseclocks(xtal);
	s5p_register_clocks(xtal);
	s5p6450_register_clocks();
	s5p6450_setup_clocks();
}

/*
 * s5p64x0_init_irq
 *
 * register the CPU interrupts
 */

void __init s5p6440_init_irq(void)
{
	/* S5P6440 supports only 2 VIC */
	/* S5P6440 supports 2 VIC */
	u32 vic[2];

	/*
@@ -120,27 +168,41 @@ void __init s5p6440_init_irq(void)
	s5p_init_irq(vic, ARRAY_SIZE(vic));
}

struct sysdev_class s5p6440_sysclass = {
	.name	= "s5p6440-core",
void __init s5p6450_init_irq(void)
{
	/* S5P6450 supports only 2 VIC */
	u32 vic[2];

	/*
	 * VIC0 is missing IRQ_VIC0[(13-15), (21-22)]
	 * VIC1 is missing IRQ VIC1[12, 14, 23]
	 */
	vic[0] = 0xff9f1fff;
	vic[1] = 0xff7fafff;

	s5p_init_irq(vic, ARRAY_SIZE(vic));
}

struct sysdev_class s5p64x0_sysclass = {
	.name	= "s5p64x0-core",
};

static struct sys_device s5p6440_sysdev = {
	.cls	= &s5p6440_sysclass,
static struct sys_device s5p64x0_sysdev = {
	.cls	= &s5p64x0_sysclass,
};

static int __init s5p6440_core_init(void)
static int __init s5p64x0_core_init(void)
{
	return sysdev_class_register(&s5p6440_sysclass);
	return sysdev_class_register(&s5p64x0_sysclass);
}
core_initcall(s5p64x0_core_init);

core_initcall(s5p6440_core_init);

int __init s5p6440_init(void)
int __init s5p64x0_init(void)
{
	printk(KERN_INFO "S5P6440: Initializing architecture\n");
	printk(KERN_INFO "S5P64X0(S5P6440/S5P6450): Initializing architecture\n");

	/* set idle function */
	pm_idle = s5p6440_idle;
	pm_idle = s5p64x0_idle;

	return sysdev_register(&s5p6440_sysdev);
	return sysdev_register(&s5p64x0_sysdev);
}
+33 −0
Original line number Diff line number Diff line
/* linux/arch/arm/mach-s5p6440/include/mach/debug-macro.S
/* linux/arch/arm/mach-s5p64x0/include/mach/debug-macro.S
 *
 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com
 *
 * 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
@@ -10,28 +10,24 @@

/* pull in the relevant register and map files. */

#include <mach/map.h>
#include <plat/regs-serial.h>
#include <plat/map-base.h>
#include <plat/map-s5p.h>

	/* note, for the boot process to work we have to keep the UART
	 * virtual address aligned to an 1MiB boundary for the L1
	 * mapping the head code makes. We keep the UART virtual address
	 * aligned and add in the offset when we load the value here.
	 */
#include <plat/regs-serial.h>

	.macro addruart, rx, rtmp
		mrc	p15, 0, \rx, c1, c0
		tst	\rx, #1
		ldreq	\rx, = S3C_PA_UART
		ldrne	\rx, = S3C_VA_UART
	.macro addruart, rp, rv
		mov	\rp, #0xE0000000
		orr	\rp, \rp, #0x00100000
		ldr	\rp, [\rp, #0x118 ]
		and	\rp, \rp, #0xff000
		teq	\rp, #0x50000		@@ S5P6450
		ldreq	\rp, =0xEC800000
		movne	\rp, #0xEC000000	@@ S5P6440
		ldrne	\rv, = S3C_VA_UART
#if CONFIG_DEBUG_S3C_UART != 0
		add	\rx, \rx, #(0x400 * CONFIG_DEBUG_S3C_UART)
		add	\rp, \rp, #(0x400 * CONFIG_DEBUG_S3C_UART)
		add	\rv, \rv, #(0x400 * CONFIG_DEBUG_S3C_UART)
#endif
	.endm

/* include the reset of the code which will do the work, we're only
 * compiling for a single cpu processor type so the default of s3c2440
 * will be fine with us.
 */

#include <plat/debug-macro.S>
+4 −4
Original line number Diff line number Diff line
/* linux/arch/arm/mach-s5p6440/include/mach/entry-macro.S
/* linux/arch/arm/mach-s5p64x0/include/mach/entry-macro.S
 *
 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com/
 * Copyright (c) 2009-2010 Samsung Electronics Co., Ltd.
 *		http://www.samsung.com
 *
 * Low-level IRQ helper macros for the Samsung S5P6440
 * Low-level IRQ helper macros for the Samsung S5P64X0
 *
 * 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
Loading