s3c2440reg.h revision 236990
1147476Sdumbbell/*-
2147476Sdumbbell * Copyright (C) 2009 Andrew Turner
3147476Sdumbbell * All rights reserved.
4147476Sdumbbell *
5230132Suqs * Redistribution and use in source and binary forms, with or without
6147476Sdumbbell * modification, are permitted provided that the following conditions
7147476Sdumbbell * are met:
8147476Sdumbbell * 1. Redistributions of source code must retain the above copyright
9147476Sdumbbell *    notice, this list of conditions and the following disclaimer.
10147476Sdumbbell * 2. Redistributions in binary form must reproduce the above copyright
11147476Sdumbbell *    notice, this list of conditions and the following disclaimer in the
12147476Sdumbbell *    documentation and/or other materials provided with the distribution.
13147476Sdumbbell *
14147476Sdumbbell * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15147476Sdumbbell * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16151897Srwatson * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17147476Sdumbbell * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18147476Sdumbbell * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19147476Sdumbbell * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20147476Sdumbbell * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21147476Sdumbbell * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22147476Sdumbbell * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23147476Sdumbbell * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24147476Sdumbbell * SUCH DAMAGE.
25147476Sdumbbell *
26147476Sdumbbell * $FreeBSD: head/sys/arm/s3c2xx0/s3c2440reg.h 236990 2012-06-13 04:59:00Z imp $
27147476Sdumbbell */
28147476Sdumbbell
29147476Sdumbbell/*
30147476Sdumbbell * Samsung S3C2440X processor is ARM920T based integrated CPU
31147476Sdumbbell *
32147476Sdumbbell * Reference:
33151532Sdumbbell *  S3C2440A/S3C2442B User's Manual
34147476Sdumbbell */
35147476Sdumbbell#ifndef _ARM_S3C2XX0_S3C2440REG_H_
36147476Sdumbbell#define	_ARM_S3C2XX0_S3C2440REG_H_
37147476Sdumbbell
38147476Sdumbbell/* common definitions for S3C2410 and S3C2440 */
39147476Sdumbbell#include <arm/s3c2xx0/s3c24x0reg.h>
40147476Sdumbbell
41147476Sdumbbell/*
42147476Sdumbbell * Memory Map
43147476Sdumbbell */
44147476Sdumbbell#define	S3C2440_BANK_SIZE 	0x08000000
45147476Sdumbbell#define	S3C2440_BANK_START(n)	(S3C2410_BANK_SIZE*(n))
46147476Sdumbbell#define	S3C2440_SDRAM_START	S3C2410_BANK_START(6)
47147476Sdumbbell
48147476Sdumbbell
49147476Sdumbbell/* interrupt control */
50147476Sdumbbell#define	S3C2440_SUBIRQ_MAX	(S3C24X0_SUBIRQ_MIN+10)
51147476Sdumbbell
52147476Sdumbbell/* Clock control */
53147476Sdumbbell/* CLKMAN_CLKCON */
54147476Sdumbbell#define	 S3C2440_CLKCON_STOP	(1<<0)	/* 1=transition to STOP mode */
55147476Sdumbbell/* CLKMAN_CLKDIVN */
56147476Sdumbbell#define	 S3C2440_CLKDIVN_HDIVN	(3<<1)	/* hclk */
57147476Sdumbbell#define S3C2440_CLKMAN_CAMDIVN	0x18
58147476Sdumbbell#define  S3C2440_CAMDIVN_HCLK4_HALF	(1<<9)
59147476Sdumbbell#define  S3C2440_CAMDIVN_HCLK3_HALF	(1<<8)
60147476Sdumbbell
61147476Sdumbbell/* NAND Flash controller */
62147476Sdumbbell#define S3C2440_NANDFC_SIZE	0x40
63147476Sdumbbell
64147476Sdumbbell#define S3C2440_NANDFC_NFCONT	0x04
65147476Sdumbbell#define  S3C2440_NFCONT_LOCK_TIGHT	(1<<13) /* Lock part of the NAND */
66147476Sdumbbell#define  S3C2440_NFCONT_SOFT_LOCK	(1<<12) /* Soft lock part of the NAND */
67147476Sdumbbell#define  S3C2440_NFCONT_ILLEGAL_ACC_INT	(1<<10) /* Illegal access interrupt */
68147476Sdumbbell#define  S3C2440_NFCONT_RNB_INT		(1<<9) /* RnB transition interrupt */
69147476Sdumbbell#define  S3C2440_NFCONT_RNB_TRANS_MODE	(1<<8) /* RnB transition mode */
70147476Sdumbbell#define  S3C2440_NFCONT_SPARE_ECC_LOCK	(1<<6) /* Lock spare ECC generation */
71147476Sdumbbell#define  S3C2440_NFCONT_MAIN_ECC_LOCK	(1<<5) /* Lock main ECC generation */
72147476Sdumbbell#define  S3C2440_NFCONT_INIT_ECC	(1<<4) /* Init ECC encoder/decoder */
73147476Sdumbbell#define  S3C2440_NFCONT_NCE		(1<<1) /* NAND Chip select */
74147476Sdumbbell#define  S3C2440_NFCONT_ENABLE		(1<<0) /* Enable the controller */
75147476Sdumbbell#define S3C2440_NANDFC_NFCMMD	0x08
76147476Sdumbbell#define S3C2440_NANDFC_NFADDR	0x0c
77147476Sdumbbell#define S3C2440_NANDFC_NFDATA	0x10
78147476Sdumbbell#define S3C2440_NANDFC_NFSTAT	0x20
79147476Sdumbbell
80147476Sdumbbell/* MMC/SD */
81151532Sdumbbell/* SDI_CON */
82175294Sattilio#define  S3C2440_CON_RESET		(1<<8)
83147476Sdumbbell#define  S3C2440_CON_CLOCK_TYPE		(1<<5)
84151532Sdumbbell/* SDI_FSTA */
85175202Sattilio#define  S3c2440_FSTA_RESET		(1<<16)
86147476Sdumbbell#define  S3C2440_FSTA_FAIL_ERROR_MSK	(3<<14)
87147476Sdumbbell#define  S3C2440_FSTA_FAIL_NONE		(0<<14)
88147476Sdumbbell#define  S3C2440_FSTA_FAIL_FIFO		(1<<14)
89147476Sdumbbell#define  S3C2440_FSTA_FAIL_LAST_TRANS	(2<<14)
90147476Sdumbbell
91147476Sdumbbell/* GPIO */
92147476Sdumbbell#define	S3C2440_GPIO_SIZE	0xd0
93147476Sdumbbell
94147476Sdumbbell/* SD interface */
95147476Sdumbbell#define	S3C2410_SDI_SIZE 	0x44
96147476Sdumbbell#define  DCON_START		(1<<14) /* Start the data transfer */
97147476Sdumbbell#define S3C2440_SDI_IMSK	0x3c /* Interrupt mask */
98147476Sdumbbell#define  S3C2440_SDI_IMASK_ALL	0x3C7C0
99147476Sdumbbell#define S3C2440_SDI_DAT		0x40
100147476Sdumbbell
101147476Sdumbbell/* ADC */
102147476Sdumbbell#define	 ADCTSC_UD_SEN		(1<<8)
103147476Sdumbbell#define	S3C2440_ADC_SIZE 	0x18
104147476Sdumbbell
105147476Sdumbbell/* UART */
106147476Sdumbbell#define  S3C2440_UFSTAT_TXCOUNT	(0x3f << 8)
107147476Sdumbbell#define  S3C2440_UFSTAT_RXCOUNT	(0x3f << 0)
108147476Sdumbbell
109147476Sdumbbell#endif /* _ARM_S3C2XX0_S3C2440REG_H_ */
110147476Sdumbbell