Skip to contentSkip to conversation

Share header files of Faraday controllers from a320 SoC.

PATCH New Macpaul Lin 1 participant 4 messages Oct 28, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Share header files of Faraday controllers from a320 SoC.

The following three device controller inside a320 SoC are Soft IP which are also used by other SoC products. Here we suggest to move those header files out from a320 SoC folder into drivers folder. This change should provide header file sharing with multiple SoC.

Macpaul Lin (3):
ftpmu010: move ftpmu010 power controller to drivers/power folder
fttmr010: move fttmr010 controller to drivers/timer folder
ftsdmc020: move ftsdmc020 sdram controller to driver/misc folder

 arch/arm/cpu/arm920t/a320/timer.c          |    4 +-
 arch/arm/include/asm/arch-a320/ftpmu010.h  |  146 ----------------------------
 arch/arm/include/asm/arch-a320/ftsdmc020.h |  103 -------------------
 arch/arm/include/asm/arch-a320/fttmr010.h  |   73 --------------
 board/faraday/a320evb/lowlevel_init.S      |    2 +-
 drivers/misc/ftsdmc020.h                   |  103 +++++++++++++++++++
 drivers/power/ftpmu010.h                   |  146 ++++++++++++++++++++++++++++
 drivers/timer/fttmr010.h                   |   73 ++++++++++++++
 8 files changed, 325 insertions(+), 325 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-a320/ftpmu010.h
 delete mode 100644 arch/arm/include/asm/arch-a320/ftsdmc020.h
 delete mode 100644 arch/arm/include/asm/arch-a320/fttmr010.h
 create mode 100644 drivers/misc/ftsdmc020.h
 create mode 100644 drivers/power/ftpmu010.h
 create mode 100644 drivers/timer/fttmr010.h
Signature · 1 line
1.7.3.2
#1 lore raw

PATCH 1/3 ftpmu010: move ftpmu010 power controller to drivers/power folder

Move the header file and definitions of ftpmu010
power control unit from a320 SoC folder to
"drivers/power" folder.

This change will let other SoC which also use ftpmu010 could share the same header file.

---
 arch/arm/cpu/arm920t/a320/timer.c         |    2 +-
 arch/arm/include/asm/arch-a320/ftpmu010.h |  146 -----------------------------
 drivers/power/ftpmu010.h                  |  146 +++++++++++++++++++++++++++++
 3 files changed, 147 insertions(+), 147 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-a320/ftpmu010.h
 create mode 100644 drivers/power/ftpmu010.h
arch/arm/cpu/arm920t/a320/timer.c +1 -1
index d2e316f..4718ae6 100644
@@ -19,7 +19,7 @@
 
 #include <common.h>
 #include <asm/io.h>
-#include <asm/arch/ftpmu010.h>
+#include "../../../../../drivers/power/ftpmu010.h"
 #include <asm/arch/fttmr010.h>
 
 static ulong timestamp;
arch/arm/include/asm/arch-a320/ftpmu010.h deleted +0 -146

146 lines not on this page · raw message

drivers/power/ftpmu010.h new file +146 -0

146 lines not on this page · raw message

Signature · 1 line
1.7.3.2
#2 lore raw

PATCH 2/3 fttmr010: move fttmr010 controller to drivers/timer folder

In reply to Macpaul Lin

Move the header file and definitions of fttmr010
power control unit from a320 SoC folder to
"drivers/timer" folder.

This change will let other SoC which also use fttmr010 could share the same header file.

---
 arch/arm/cpu/arm920t/a320/timer.c         |    2 +-
 arch/arm/include/asm/arch-a320/fttmr010.h |   73 -----------------------------
 drivers/timer/fttmr010.h                  |   73 +++++++++++++++++++++++++++++
 3 files changed, 74 insertions(+), 74 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-a320/fttmr010.h
 create mode 100644 drivers/timer/fttmr010.h
arch/arm/cpu/arm920t/a320/timer.c +1 -1
index 4718ae6..f650126 100644
@@ -20,7 +20,7 @@
 #include <common.h>
 #include <asm/io.h>
 #include "../../../../../drivers/power/ftpmu010.h"
-#include <asm/arch/fttmr010.h>
+#include "../../../../../drivers/timer/fttmr010.h"
 
 static ulong timestamp;
 static ulong lastdec;
arch/arm/include/asm/arch-a320/fttmr010.h deleted +0 -73

73 lines not on this page · raw message

drivers/timer/fttmr010.h new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
1.7.3.2
#3 lore raw

PATCH 3/3 ftsdmc020: move ftsdmc020 sdram controller to driver/misc folder

In reply to Macpaul Lin

Move the header file and definitions of ftsdmc020
sdram control unit from a320 SoC folder to
"drivers/misc" folder.

This change will let other SoC which also use ftsdmc020 could share the same header file.

---
 arch/arm/include/asm/arch-a320/ftsdmc020.h |  103 ----------------------------
 board/faraday/a320evb/lowlevel_init.S      |    2 +-
 drivers/misc/ftsdmc020.h                   |  103 ++++++++++++++++++++++++++++
 3 files changed, 104 insertions(+), 104 deletions(-)
 delete mode 100644 arch/arm/include/asm/arch-a320/ftsdmc020.h
 create mode 100644 drivers/misc/ftsdmc020.h
arch/arm/include/asm/arch-a320/ftsdmc020.h deleted +0 -103
deleted file mode 100644
index 0699772..0000000
@@ -1,103 +0,0 @@
-/*
- * (C) Copyright 2009 Faraday Technology
- * Po-Yu Chuang <[email protected]>
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-/*
- * SDRAM Controller
- */
-#ifndef __FTSDMC020_H
-#define __FTSDMC020_H
-
-#define FTSDMC020_OFFSET_TP0		0x00
-#define FTSDMC020_OFFSET_TP1		0x04
-#define FTSDMC020_OFFSET_CR		0x08
-#define FTSDMC020_OFFSET_BANK0_BSR	0x0C
-#define FTSDMC020_OFFSET_BANK1_BSR	0x10
-#define FTSDMC020_OFFSET_BANK2_BSR	0x14
-#define FTSDMC020_OFFSET_BANK3_BSR	0x18
-#define FTSDMC020_OFFSET_BANK4_BSR	0x1C
-#define FTSDMC020_OFFSET_BANK5_BSR	0x20
-#define FTSDMC020_OFFSET_BANK6_BSR	0x24
-#define FTSDMC020_OFFSET_BANK7_BSR	0x28
-#define FTSDMC020_OFFSET_ACR		0x34
-
-/*
- * Timing Parametet 0 Register
- */
-#define FTSDMC020_TP0_TCL(x)	((x) & 0x3)
-#define FTSDMC020_TP0_TWR(x)	(((x) & 0x3) << 4)
-#define FTSDMC020_TP0_TRF(x)	(((x) & 0xf) << 8)
-#define FTSDMC020_TP0_TRCD(x)	(((x) & 0x7) << 12)
-#define FTSDMC020_TP0_TRP(x)	(((x) & 0xf) << 16)
-#define FTSDMC020_TP0_TRAS(x)	(((x) & 0xf) << 20)
-
-/*
- * Timing Parametet 1 Register
- */
-#define FTSDMC020_TP1_REF_INTV(x)	((x) & 0xffff)
-#define FTSDMC020_TP1_INI_REFT(x)	(((x) & 0xf) << 16)
-#define FTSDMC020_TP1_INI_PREC(x)	(((x) & 0xf) << 20)
-
-/*
- * Configuration Register
- */
-#define FTSDMC020_CR_SREF	(1 << 0)
-#define FTSDMC020_CR_PWDN	(1 << 1)
-#define FTSDMC020_CR_ISMR	(1 << 2)
-#define FTSDMC020_CR_IREF	(1 << 3)
-#define FTSDMC020_CR_IPREC	(1 << 4)
-#define FTSDMC020_CR_REFTYPE	(1 << 5)
-
-/*
- * SDRAM External Bank Base/Size Register
- */
-#define FTSDMC020_BANK_ENABLE		(1 << 28)
-
-#define FTSDMC020_BANK_BASE(addr)	(((addr) >> 20) << 16)
-
-#define FTSDMC020_BANK_DDW_X4		(0 << 12)
-#define FTSDMC020_BANK_DDW_X8		(1 << 12)
-#define FTSDMC020_BANK_DDW_X16		(2 << 12)
-#define FTSDMC020_BANK_DDW_X32		(3 << 12)
-
-#define FTSDMC020_BANK_DSZ_16M		(0 << 8)
-#define FTSDMC020_BANK_DSZ_64M		(1 << 8)
-#define FTSDMC020_BANK_DSZ_128M		(2 << 8)
-#define FTSDMC020_BANK_DSZ_256M		(3 << 8)
-
-#define FTSDMC020_BANK_MBW_8		(0 << 4)
-#define FTSDMC020_BANK_MBW_16		(1 << 4)
-#define FTSDMC020_BANK_MBW_32		(2 << 4)
-
-#define FTSDMC020_BANK_SIZE_1M		0x0
-#define FTSDMC020_BANK_SIZE_2M		0x1
-#define FTSDMC020_BANK_SIZE_4M		0x2
-#define FTSDMC020_BANK_SIZE_8M		0x3
-#define FTSDMC020_BANK_SIZE_16M		0x4
-#define FTSDMC020_BANK_SIZE_32M		0x5
-#define FTSDMC020_BANK_SIZE_64M		0x6
-#define FTSDMC020_BANK_SIZE_128M	0x7
-#define FTSDMC020_BANK_SIZE_256M	0x8
-
-/*
- * Arbiter Control Register
- */
-#define FTSDMC020_ACR_TOC(x)	((x) & 0x1f)
-#define FTSDMC020_ACR_TOE	(1 << 8)
-
-#endif	/* __FTSDMC020_H */
board/faraday/a320evb/lowlevel_init.S +1 -1
index 97718c0..416e87c 100644
@@ -21,7 +21,7 @@
 #include <version.h>
 
 #include <asm/macro.h>
-#include <asm/arch/ftsdmc020.h>
+#include "../../../drivers/misc/ftsdmc020.h"
 
 /*
  * parameters for the SDRAM controller
drivers/misc/ftsdmc020.h new file +103 -0

103 lines not on this page · raw message

Signature · 1 line
1.7.3.2