From d28707dbce1e9ac2017ad051da4133bf22b4204f Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:10 +0100 Subject: Add support for the tms320671x host port interface (HPI) --- include/configs/spc1920.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'include') diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index 9d3609a67d3..6e99699b30d 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -330,6 +330,40 @@ MBMR_TLFB_4X) /* 0x04804114 */ /* 0x10802114 */ +/* + * DSP Host Port Interface CS3 + */ +#define CFG_SPC1920_HPI_BASE 0x90000000 +#define CFG_PRELIM_OR3_AM 0xF0000000 + +#define CFG_OR3_PRELIM (CFG_PRELIM_OR3_AM | \ + OR_G5LS | \ + OR_SCY_0_CLK | \ + OR_BI) + +#define CFG_BR3_PRELIM ((CFG_SPC1920_HPI_BASE & BR_BA_MSK) | \ + BR_MS_UPMA | \ + BR_PS_16 | \ + BR_V); + +#define CFG_MAMR (MAMR_GPL_A4DIS | \ + MAMR_RLFA_5X | \ + MAMR_WLFA_5X) + +#define CONFIG_SPC1920_HPI_TEST + +#ifdef CONFIG_SPC1920_HPI_TEST +#define HPI_REG(x) (*((volatile u16 *) (CFG_SPC1920_HPI_BASE + x))) +#define HPI_HPIC_1 HPI_REG(0) +#define HPI_HPIC_2 HPI_REG(2) +#define HPI_HPIA_1 HPI_REG(0x2000000) +#define HPI_HPIA_2 HPI_REG(0x2000000 + 2) +#define HPI_HPID_INC_1 HPI_REG(0x1000000) +#define HPI_HPID_INC_2 HPI_REG(0x1000000 + 2) +#define HPI_HPID_NOINC_1 HPI_REG(0x3000000) +#define HPI_HPID_NOINC_2 HPI_REG(0x3000000 + 2) +#endif /* CONFIG_SPC1920_HPI_TEST */ + /* PLD CS5 */ #define CFG_SPC1920_PLD_BASE 0x80000000 #define CFG_PRELIM_OR5_AM 0xffff8000 -- cgit v1.3.1 From 3f34f869162750e5e999fd140f884f5de952bcfe Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:10 +0100 Subject: Add / enable I2C support on the spc1920 board --- include/configs/spc1920.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index 6e99699b30d..6db0d1a1c83 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -89,6 +89,7 @@ | CFG_CMD_PING \ | CFG_CMD_DHCP \ | CFG_CMD_IMMAP \ + | CFG_CMD_I2C \ | CFG_CMD_MII) /* & ~( CFG_CMD_NET)) */ @@ -197,9 +198,30 @@ * I2C configuration */ #if (CONFIG_COMMANDS & CFG_CMD_I2C) -#define CONFIG_HARD_I2C 1 /* I2C with hardware support */ -#define CFG_I2C_SPEED 400000 /* I2C speed and slave address defaults */ -#define CFG_I2C_SLAVE 0x7F +/* enable I2C and select the hardware/software driver */ +#undef CONFIG_HARD_I2C /* I2C with hardware support */ +#define CONFIG_SOFT_I2C 1 /* I2C bit-banged */ + +#define CFG_I2C_SPEED 93000 /* 93 kHz is supposed to work */ +#define CFG_I2C_SLAVE 0xFE + +#ifdef CONFIG_SOFT_I2C +/* + * Software (bit-bang) I2C driver configuration + */ +#define PB_SCL 0x00000020 /* PB 26 */ +#define PB_SDA 0x00000010 /* PB 27 */ + +#define I2C_INIT (immr->im_cpm.cp_pbdir |= PB_SCL) +#define I2C_ACTIVE (immr->im_cpm.cp_pbdir |= PB_SDA) +#define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA) +#define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0) +#define I2C_SDA(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \ + else immr->im_cpm.cp_pbdat &= ~PB_SDA +#define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ + else immr->im_cpm.cp_pbdat &= ~PB_SCL +#define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */ +#endif /* CONFIG_SOFT_I2C */ #endif /*----------------------------------------------------------------------- -- cgit v1.3.1 From d8d9de1a02fbd880b613d607143d1f57342affc7 Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:10 +0100 Subject: Update the SPC1920 CMB PLD driver --- board/spc1920/pld.h | 2 +- include/configs/spc1920.h | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/board/spc1920/pld.h b/board/spc1920/pld.h index 3254f820c1e..5beb71b5cca 100644 --- a/board/spc1920/pld.h +++ b/board/spc1920/pld.h @@ -5,8 +5,8 @@ typedef struct spc1920_pld { uchar com1_en; uchar dsp_reset; uchar dsp_hpi_on; + uchar superv_mode; uchar codec_dsp_power_en; - uchar clk2_en; uchar clk3_select; uchar clk4_select; } spc1920_pld_t; diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index 6db0d1a1c83..f8909b1d1d4 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -89,7 +89,7 @@ | CFG_CMD_PING \ | CFG_CMD_DHCP \ | CFG_CMD_IMMAP \ - | CFG_CMD_I2C \ + | CFG_CMD_I2C \ | CFG_CMD_MII) /* & ~( CFG_CMD_NET)) */ @@ -217,9 +217,9 @@ #define I2C_TRISTATE (immr->im_cpm.cp_pbdir &= ~PB_SDA) #define I2C_READ ((immr->im_cpm.cp_pbdat & PB_SDA) != 0) #define I2C_SDA(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SDA; \ - else immr->im_cpm.cp_pbdat &= ~PB_SDA + else immr->im_cpm.cp_pbdat &= ~PB_SDA #define I2C_SCL(bit) if(bit) immr->im_cpm.cp_pbdat |= PB_SCL; \ - else immr->im_cpm.cp_pbdat &= ~PB_SCL + else immr->im_cpm.cp_pbdat &= ~PB_SCL #define I2C_DELAY udelay(2) /* 1/4 I2C clock duration */ #endif /* CONFIG_SOFT_I2C */ #endif @@ -386,9 +386,11 @@ #define HPI_HPID_NOINC_2 HPI_REG(0x3000000 + 2) #endif /* CONFIG_SPC1920_HPI_TEST */ -/* PLD CS5 */ +/* + * PLD CS5 + */ #define CFG_SPC1920_PLD_BASE 0x80000000 -#define CFG_PRELIM_OR5_AM 0xffff8000 +#define CFG_PRELIM_OR5_AM 0xfff00000 #define CFG_OR5_PRELIM (CFG_PRELIM_OR5_AM | \ OR_CSNT_SAM | \ @@ -399,10 +401,6 @@ #define CFG_BR5_PRELIM ((CFG_SPC1920_PLD_BASE & BR_BA_MSK) | BR_PS_8 | BR_V); -/* #define CFG_PLD_BASE 0x30000000 */ -/* #define CFG_OR5_PRELIM 0xffff1110 */ -/* #define CFG_BR5_PRELIM 0x30000401 */ - /* * Internal Definitions * -- cgit v1.3.1 From 8139567b60d678584b05f0718a681f2047c5e14f Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:11 +0100 Subject: SMC1 uses external CLK4 instead of BRG on spc1920 --- cpu/mpc8xx/serial.c | 13 +++++++++++-- include/configs/spc1920.h | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/cpu/mpc8xx/serial.c b/cpu/mpc8xx/serial.c index 8ae584f2e1d..c8caa793d21 100644 --- a/cpu/mpc8xx/serial.c +++ b/cpu/mpc8xx/serial.c @@ -227,8 +227,17 @@ static int smc_init (void) sp->smc_smcm = 0; sp->smc_smce = 0xff; -#ifdef CFG_SPC1920_SMC1_CLK4 /* clock source is PLD */ - *((volatile uchar *) CFG_SPC1920_PLD_BASE+6) = 0xff; +#ifdef CFG_SPC1920_SMC1_CLK4 + /* clock source is PLD */ + + /* set freq to 19200 Baud */ + *((volatile uchar *) CFG_SPC1920_PLD_BASE+6) = 0x3; + /* configure clk4 as input */ + im->im_ioport.iop_pdpar |= 0x800; + im->im_ioport.iop_pddir &= ~0x800; + + cp->cp_simode = 0x0000; + cp->cp_simode |= 0x7000; #else /* Set up the baud rate generator */ smc_setbrg (); diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index f8909b1d1d4..a836d829923 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -44,7 +44,7 @@ #define CONFIG_BAUDRATE 19200 /* use PLD CLK4 instead of brg */ -#undef CFG_SPC1920_SMC1_CLK4 +#define CFG_SPC1920_SMC1_CLK4 #define CONFIG_8xx_OSCLK 10000000 /* 10 MHz oscillator on EXTCLK */ #define CONFIG_8xx_CPUCLK_DEFAULT 50000000 -- cgit v1.3.1 From 0be62728aac459ba268d6d752ed49ec0e2bc7348 Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:12 +0100 Subject: Add support for the DS3231 RTC --- include/configs/spc1920.h | 6 ++ rtc/Makefile | 2 +- rtc/ds3231.c | 193 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 rtc/ds3231.c (limited to 'include') diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index a836d829923..c6b4d3002b7 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -83,6 +83,7 @@ #ifndef CONFIG_COMMANDS #define CONFIG_COMMANDS (CONFIG_CMD_DFL \ | CFG_CMD_ASKENV \ + | CFG_CMD_DATE \ | CFG_CMD_ECHO \ | CFG_CMD_IMMAP \ | CFG_CMD_JFFS2 \ @@ -194,6 +195,11 @@ #define CFG_CACHELINE_SIZE 16 /* For all MPC8xx CPUs */ #define CFG_CACHELINE_SHIFT 4 /* log base 2 of the above value */ +#ifdef CFG_CMD_DATE +# define CONFIG_RTC_DS3231 +# define CFG_I2C_RTC_ADDR 0x68 +#endif + /*----------------------------------------------------------------------- * I2C configuration */ diff --git a/rtc/Makefile b/rtc/Makefile index cf2b24ef0dd..cdc8ac934f9 100644 --- a/rtc/Makefile +++ b/rtc/Makefile @@ -29,7 +29,7 @@ LIB = $(obj)librtc.a COBJS = date.o \ bf533_rtc.o ds12887.o ds1302.o ds1306.o ds1307.o \ - ds1337.o ds1374.o ds1556.o ds164x.o ds174x.o \ + ds1337.o ds1374.o ds1556.o ds164x.o ds174x.o ds3231.o \ m41t11.o max6900.o m48t35ax.o mc146818.o mk48t59.o \ mpc5xxx.o mpc8xx.o pcf8563.o s3c24x0_rtc.o rs5c372.o diff --git a/rtc/ds3231.c b/rtc/ds3231.c new file mode 100644 index 00000000000..50aeeb5615d --- /dev/null +++ b/rtc/ds3231.c @@ -0,0 +1,193 @@ +/* + * (C) Copyright 2006 + * Markus Klotzbuecher, mk@denx.de + * + * See file CREDITS for list of people who contributed to this + * project. + * + * 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., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + */ + +/* + * Date & Time support (no alarms) for Dallas Semiconductor (now Maxim) + * Extremly Accurate DS3231 Real Time Clock (RTC). + * + * copied from ds1337.c + */ + +#include +#include +#include +#include + +#if defined(CONFIG_RTC_DS3231) && (CONFIG_COMMANDS & CFG_CMD_DATE) + +/*---------------------------------------------------------------------*/ +#undef DEBUG_RTC + +#ifdef DEBUG_RTC +#define DEBUGR(fmt,args...) printf(fmt ,##args) +#else +#define DEBUGR(fmt,args...) +#endif +/*---------------------------------------------------------------------*/ + +/* + * RTC register addresses + */ +#define RTC_SEC_REG_ADDR 0x0 +#define RTC_MIN_REG_ADDR 0x1 +#define RTC_HR_REG_ADDR 0x2 +#define RTC_DAY_REG_ADDR 0x3 +#define RTC_DATE_REG_ADDR 0x4 +#define RTC_MON_REG_ADDR 0x5 +#define RTC_YR_REG_ADDR 0x6 +#define RTC_CTL_REG_ADDR 0x0e +#define RTC_STAT_REG_ADDR 0x0f + + +/* + * RTC control register bits + */ +#define RTC_CTL_BIT_A1IE 0x1 /* Alarm 1 interrupt enable */ +#define RTC_CTL_BIT_A2IE 0x2 /* Alarm 2 interrupt enable */ +#define RTC_CTL_BIT_INTCN 0x4 /* Interrupt control */ +#define RTC_CTL_BIT_RS1 0x8 /* Rate select 1 */ +#define RTC_CTL_BIT_RS2 0x10 /* Rate select 2 */ +#define RTC_CTL_BIT_DOSC 0x80 /* Disable Oscillator */ + +/* + * RTC status register bits + */ +#define RTC_STAT_BIT_A1F 0x1 /* Alarm 1 flag */ +#define RTC_STAT_BIT_A2F 0x2 /* Alarm 2 flag */ +#define RTC_STAT_BIT_OSF 0x80 /* Oscillator stop flag */ + + +static uchar rtc_read (uchar reg); +static void rtc_write (uchar reg, uchar val); +static uchar bin2bcd (unsigned int n); +static unsigned bcd2bin (uchar c); + + +/* + * Get the current time from the RTC + */ +void rtc_get (struct rtc_time *tmp) +{ + uchar sec, min, hour, mday, wday, mon_cent, year, control, status; + + control = rtc_read (RTC_CTL_REG_ADDR); + status = rtc_read (RTC_STAT_REG_ADDR); + sec = rtc_read (RTC_SEC_REG_ADDR); + min = rtc_read (RTC_MIN_REG_ADDR); + hour = rtc_read (RTC_HR_REG_ADDR); + wday = rtc_read (RTC_DAY_REG_ADDR); + mday = rtc_read (RTC_DATE_REG_ADDR); + mon_cent = rtc_read (RTC_MON_REG_ADDR); + year = rtc_read (RTC_YR_REG_ADDR); + + DEBUGR ("Get RTC year: %02x mon/cent: %02x mday: %02x wday: %02x " + "hr: %02x min: %02x sec: %02x control: %02x status: %02x\n", + year, mon_cent, mday, wday, hour, min, sec, control, status); + + if (status & RTC_STAT_BIT_OSF) { + printf ("### Warning: RTC oscillator has stopped\n"); + /* clear the OSF flag */ + rtc_write (RTC_STAT_REG_ADDR, + rtc_read (RTC_STAT_REG_ADDR) & ~RTC_STAT_BIT_OSF); + } + + tmp->tm_sec = bcd2bin (sec & 0x7F); + tmp->tm_min = bcd2bin (min & 0x7F); + tmp->tm_hour = bcd2bin (hour & 0x3F); + tmp->tm_mday = bcd2bin (mday & 0x3F); + tmp->tm_mon = bcd2bin (mon_cent & 0x1F); + tmp->tm_year = bcd2bin (year) + ((mon_cent & 0x80) ? 2000 : 1900); + tmp->tm_wday = bcd2bin ((wday - 1) & 0x07); + tmp->tm_yday = 0; + tmp->tm_isdst= 0; + + DEBUGR ("Get DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", + tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, + tmp->tm_hour, tmp->tm_min, tmp->tm_sec); +} + + +/* + * Set the RTC + */ +void rtc_set (struct rtc_time *tmp) +{ + uchar century; + + DEBUGR ("Set DATE: %4d-%02d-%02d (wday=%d) TIME: %2d:%02d:%02d\n", + tmp->tm_year, tmp->tm_mon, tmp->tm_mday, tmp->tm_wday, + tmp->tm_hour, tmp->tm_min, tmp->tm_sec); + + rtc_write (RTC_YR_REG_ADDR, bin2bcd (tmp->tm_year % 100)); + + century = (tmp->tm_year >= 2000) ? 0x80 : 0; + rtc_write (RTC_MON_REG_ADDR, bin2bcd (tmp->tm_mon) | century); + + rtc_write (RTC_DAY_REG_ADDR, bin2bcd (tmp->tm_wday + 1)); + rtc_write (RTC_DATE_REG_ADDR, bin2bcd (tmp->tm_mday)); + rtc_write (RTC_HR_REG_ADDR, bin2bcd (tmp->tm_hour)); + rtc_write (RTC_MIN_REG_ADDR, bin2bcd (tmp->tm_min)); + rtc_write (RTC_SEC_REG_ADDR, bin2bcd (tmp->tm_sec)); +} + + +/* + * Reset the RTC. We also enable the oscillator output on the + * SQW/INTB* pin and program it for 32,768 Hz output. Note that + * according to the datasheet, turning on the square wave output + * increases the current drain on the backup battery from about + * 600 nA to 2uA. + */ +void rtc_reset (void) +{ + rtc_write (RTC_CTL_REG_ADDR, RTC_CTL_BIT_RS1 | RTC_CTL_BIT_RS2); +} + + +/* + * Helper functions + */ + +static +uchar rtc_read (uchar reg) +{ + return (i2c_reg_read (CFG_I2C_RTC_ADDR, reg)); +} + + +static void rtc_write (uchar reg, uchar val) +{ + i2c_reg_write (CFG_I2C_RTC_ADDR, reg, val); +} + +static unsigned bcd2bin (uchar n) +{ + return ((((n >> 4) & 0x0F) * 10) + (n & 0x0F)); +} + +static unsigned char bin2bcd (unsigned int n) +{ + return (((n / 10) << 4) | (n % 10)); +} + +#endif /* (CONFIG_RTC_DS3231) && (CONFIG_COMMANDS & CFG_CMD_DATE) */ -- cgit v1.3.1 From 5921e5313fc3eadd42770c2b99badd7fae5ecf1e Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:13 +0100 Subject: Miscellanious spc1920 related cleanups --- board/spc1920/hpi.c | 1 - board/spc1920/spc1920.c | 14 ++++++++++++-- include/configs/spc1920.h | 11 +++++------ 3 files changed, 17 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/board/spc1920/hpi.c b/board/spc1920/hpi.c index 687c170a850..05dd8bd5cb2 100644 --- a/board/spc1920/hpi.c +++ b/board/spc1920/hpi.c @@ -40,7 +40,6 @@ #include "pld.h" #include "hpi.h" -#include "spc1920.h" /* led function */ #define _NOT_USED_ 0xFFFFFFFF diff --git a/board/spc1920/spc1920.c b/board/spc1920/spc1920.c index d0a6ff1eba9..d69b9151721 100644 --- a/board/spc1920/spc1920.c +++ b/board/spc1920/spc1920.c @@ -220,10 +220,20 @@ int board_early_init_f(void) immap->im_ioport.iop_pdpar &= ~(0x0040); immap->im_ioport.iop_pddir |= 0x0040; immap->im_ioport.iop_pddat |= 0x0040; - #endif - /* Enable PD10 (COM2_EN) */ + /* + * Enable console on SMC1. This requires turning on + * the com2_en signal and SMC1_DISABLE + */ + + /* SMC1_DISABLE: PB17 */ + immap->im_cpm.cp_pbodr &= ~0x4000; + immap->im_cpm.cp_pbpar &= ~0x4000; + immap->im_cpm.cp_pbdir |= 0x4000; + immap->im_cpm.cp_pbdat &= ~0x4000; + + /* COM2_EN: PD10 */ immap->im_ioport.iop_pdpar &= ~0x0020; immap->im_ioport.iop_pddir &= ~0x4000; immap->im_ioport.iop_pddir |= 0x0020; diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index c6b4d3002b7..dcff8a6c9e8 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -51,12 +51,12 @@ #define CFG_8xx_CPUCLK_MIN 40000000 #define CFG_8xx_CPUCLK_MAX 133000000 -#define CFG_RESET_ADDRESS 0xf8000000 +#define CFG_RESET_ADDRESS 0xC0000000 #define CONFIG_BOARD_EARLY_INIT_F +#define CONFIG_LAST_STAGE_INIT - -#if 1 +#if 0 #define CONFIG_BOOTDELAY -1 /* autoboot disabled */ #else #define CONFIG_BOOTDELAY 5 /* autoboot after 5 seconds */ @@ -89,7 +89,6 @@ | CFG_CMD_JFFS2 \ | CFG_CMD_PING \ | CFG_CMD_DHCP \ - | CFG_CMD_IMMAP \ | CFG_CMD_I2C \ | CFG_CMD_MII) /* & ~( CFG_CMD_NET)) */ @@ -248,7 +247,7 @@ *----------------------------------------------------------------------- * PCMCIA config., multi-function pin tri-state */ -#define CFG_SIUMCR (SIUMCR_DBGC00 | SIUMCR_DBPC00 | SIUMCR_MLRC01) +#define CFG_SIUMCR (SIUMCR_FRC) /*----------------------------------------------------------------------- * TBSCR - Time Base Status and Control 11-26 @@ -393,7 +392,7 @@ #endif /* CONFIG_SPC1920_HPI_TEST */ /* - * PLD CS5 + * PLD CS5 */ #define CFG_SPC1920_PLD_BASE 0x80000000 #define CFG_PRELIM_OR5_AM 0xfff00000 -- cgit v1.3.1 From 38ccd2fdf3364a53fe80e9b365303ecdafc9e223 Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:13 +0100 Subject: SPC1920: update the HPI register addresses to work with the second generation of hardware --- include/configs/spc1920.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index dcff8a6c9e8..8f5eace6925 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -383,12 +383,12 @@ #define HPI_REG(x) (*((volatile u16 *) (CFG_SPC1920_HPI_BASE + x))) #define HPI_HPIC_1 HPI_REG(0) #define HPI_HPIC_2 HPI_REG(2) -#define HPI_HPIA_1 HPI_REG(0x2000000) -#define HPI_HPIA_2 HPI_REG(0x2000000 + 2) -#define HPI_HPID_INC_1 HPI_REG(0x1000000) -#define HPI_HPID_INC_2 HPI_REG(0x1000000 + 2) -#define HPI_HPID_NOINC_1 HPI_REG(0x3000000) -#define HPI_HPID_NOINC_2 HPI_REG(0x3000000 + 2) +#define HPI_HPIA_1 HPI_REG(0x2000008) +#define HPI_HPIA_2 HPI_REG(0x2000008 + 2) +#define HPI_HPID_INC_1 HPI_REG(0x1000004) +#define HPI_HPID_INC_2 HPI_REG(0x1000004 + 2) +#define HPI_HPID_NOINC_1 HPI_REG(0x300000c) +#define HPI_HPID_NOINC_2 HPI_REG(0x300000c + 2) #endif /* CONFIG_SPC1920_HPI_TEST */ /* -- cgit v1.3.1 From 9295acb77481cf099ef9b40e1fa2d145b3c7490c Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:13 +0100 Subject: SPC1920: add support for the FM18L08 Ramtron FRAM --- board/spc1920/spc1920.c | 5 +++++ include/configs/spc1920.h | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/board/spc1920/spc1920.c b/board/spc1920/spc1920.c index d69b9151721..06ec60e2a75 100644 --- a/board/spc1920/spc1920.c +++ b/board/spc1920/spc1920.c @@ -175,6 +175,11 @@ long int initdram (int board_type) /* initalize the DSP Host Port Interface */ hpi_init(); + /* PLD Setup */ + memctl->memc_or4 = CFG_OR4_PRELIM; + memctl->memc_br4 = CFG_BR4_PRELIM; + udelay(1000); + /* PLD Setup */ memctl->memc_or5 = CFG_OR5_PRELIM; memctl->memc_br5 = CFG_BR5_PRELIM; diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index 8f5eace6925..0b07a45d674 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -391,11 +391,24 @@ #define HPI_HPID_NOINC_2 HPI_REG(0x300000c + 2) #endif /* CONFIG_SPC1920_HPI_TEST */ +/* + * Ramtron FM18L08 FRAM 32KB on CS4 + */ +#define CFG_SPC1920_FRAM_BASE 0x80100000 +#define CFG_PRELIM_OR4_AM 0xffff8000 +#define CFG_OR4_PRELIM (CFG_PRELIM_OR4_AM | \ + OR_ACS_DIV2 | \ + OR_BI | \ + OR_SCY_4_CLK | \ + OR_TRLX) + +#define CFG_BR4_PRELIM ((CFG_SPC1920_FRAM_BASE & BR_BA_MSK) | BR_PS_8 | BR_V); + /* * PLD CS5 */ #define CFG_SPC1920_PLD_BASE 0x80000000 -#define CFG_PRELIM_OR5_AM 0xfff00000 +#define CFG_PRELIM_OR5_AM 0xffff8000 #define CFG_OR5_PRELIM (CFG_PRELIM_OR5_AM | \ OR_CSNT_SAM | \ -- cgit v1.3.1 From 8fc2102faa23593c80381437c09f7745a14deb40 Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 14:57:14 +0100 Subject: Fix the cpu speed setup to work with all boards. --- include/configs/spc1920.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index 0b07a45d674..fb7062400ba 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -310,7 +310,7 @@ * FLASH timing: */ #define CFG_OR_TIMING_FLASH (OR_ACS_DIV1 | OR_TRLX | OR_CSNT_SAM | \ - OR_SCY_3_CLK | OR_EHTR | OR_BI) + OR_SCY_6_CLK | OR_EHTR | OR_BI) #define CFG_OR0_REMAP (CFG_REMAP_OR_AM | CFG_OR_TIMING_FLASH) #define CFG_OR0_PRELIM (CFG_PRELIM_OR_AM | CFG_OR_TIMING_FLASH) -- cgit v1.3.1 From 67fea022fa957f59653b5238c7496f80a6b70432 Mon Sep 17 00:00:00 2001 From: Markus Klotzbuecher Date: Tue, 9 Jan 2007 16:02:48 +0100 Subject: SPC1920: cleanup memory contoller setup --- board/spc1920/hpi.c | 4 ++-- board/spc1920/spc1920.c | 11 +++-------- include/configs/spc1920.h | 10 +++++----- 3 files changed, 10 insertions(+), 15 deletions(-) (limited to 'include') diff --git a/board/spc1920/hpi.c b/board/spc1920/hpi.c index 05dd8bd5cb2..3c36f7911bc 100644 --- a/board/spc1920/hpi.c +++ b/board/spc1920/hpi.c @@ -148,8 +148,8 @@ int hpi_init(void) udelay(100); memctl->memc_mamr = CFG_MAMR; - memctl->memc_or3 = CFG_OR3_PRELIM; - memctl->memc_br3 = CFG_BR3_PRELIM; + memctl->memc_or3 = CFG_OR3; + memctl->memc_br3 = CFG_BR3; /* reset dsp */ dsp_reset(); diff --git a/board/spc1920/spc1920.c b/board/spc1920/spc1920.c index 06ec60e2a75..1f5dcb5d3e0 100644 --- a/board/spc1920/spc1920.c +++ b/board/spc1920/spc1920.c @@ -175,14 +175,9 @@ long int initdram (int board_type) /* initalize the DSP Host Port Interface */ hpi_init(); - /* PLD Setup */ - memctl->memc_or4 = CFG_OR4_PRELIM; - memctl->memc_br4 = CFG_BR4_PRELIM; - udelay(1000); - - /* PLD Setup */ - memctl->memc_or5 = CFG_OR5_PRELIM; - memctl->memc_br5 = CFG_BR5_PRELIM; + /* FRAM Setup */ + memctl->memc_or4 = CFG_OR4; + memctl->memc_br4 = CFG_BR4; udelay(1000); return (size_b0); diff --git a/include/configs/spc1920.h b/include/configs/spc1920.h index fb7062400ba..09bbebdce89 100644 --- a/include/configs/spc1920.h +++ b/include/configs/spc1920.h @@ -361,14 +361,14 @@ * DSP Host Port Interface CS3 */ #define CFG_SPC1920_HPI_BASE 0x90000000 -#define CFG_PRELIM_OR3_AM 0xF0000000 +#define CFG_PRELIM_OR3_AM 0xF8000000 -#define CFG_OR3_PRELIM (CFG_PRELIM_OR3_AM | \ +#define CFG_OR3 (CFG_PRELIM_OR3_AM | \ OR_G5LS | \ OR_SCY_0_CLK | \ OR_BI) -#define CFG_BR3_PRELIM ((CFG_SPC1920_HPI_BASE & BR_BA_MSK) | \ +#define CFG_BR3 ((CFG_SPC1920_HPI_BASE & BR_BA_MSK) | \ BR_MS_UPMA | \ BR_PS_16 | \ BR_V); @@ -396,13 +396,13 @@ */ #define CFG_SPC1920_FRAM_BASE 0x80100000 #define CFG_PRELIM_OR4_AM 0xffff8000 -#define CFG_OR4_PRELIM (CFG_PRELIM_OR4_AM | \ +#define CFG_OR4 (CFG_PRELIM_OR4_AM | \ OR_ACS_DIV2 | \ OR_BI | \ OR_SCY_4_CLK | \ OR_TRLX) -#define CFG_BR4_PRELIM ((CFG_SPC1920_FRAM_BASE & BR_BA_MSK) | BR_PS_8 | BR_V); +#define CFG_BR4 ((CFG_SPC1920_FRAM_BASE & BR_BA_MSK) | BR_PS_8 | BR_V); /* * PLD CS5 -- cgit v1.3.1 From d9384de2f571046e71081bae22b49e3d5ca2e3d5 Mon Sep 17 00:00:00 2001 From: Marian Balakowicz Date: Wed, 10 Jan 2007 00:26:15 +0100 Subject: CAM5200 flash driver modifications: - use CFI driver (replaces custom flash driver) for main 'cam5200' target - add second build target 'cam5200_niosflash' which still uses custom driver --- Makefile | 5 +++++ board/tqm5200/cam5200_flash.c | 4 ++-- include/configs/TQM5200.h | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 12 deletions(-) (limited to 'include') diff --git a/Makefile b/Makefile index a973dffc52a..0cad2263acd 100644 --- a/Makefile +++ b/Makefile @@ -557,6 +557,7 @@ Total5200_Rev2_lowboot_config: unconfig @$(MKCONFIG) -a Total5200 ppc mpc5xxx total5200 cam5200_config \ +cam5200_niosflash_config \ fo300_config \ MiniFAP_config \ TQM5200S_config \ @@ -574,6 +575,10 @@ TQM5200_STK100_config: unconfig echo "#define CONFIG_TQM5200_B" >>$(obj)include/config.h ; \ echo "... TQM5200S on Cam5200" ; \ } + @[ -z "$(findstring niosflash,$@)" ] || \ + { echo "#define CONFIG_CAM5200_NIOSFLASH" >>$(obj)include/config.h ; \ + echo "... with NIOS flash driver" ; \ + } @[ -z "$(findstring fo300,$@)" ] || \ { echo "#define CONFIG_FO300" >>$(obj)include/config.h ; \ echo "... TQM5200 on FO300" ; \ diff --git a/board/tqm5200/cam5200_flash.c b/board/tqm5200/cam5200_flash.c index 8c3f62e398c..b3f095d807f 100644 --- a/board/tqm5200/cam5200_flash.c +++ b/board/tqm5200/cam5200_flash.c @@ -25,7 +25,7 @@ #include #include -#ifdef CONFIG_CAM5200 +#if defined(CONFIG_CAM5200) && defined(CONFIG_CAM5200_NIOSFLASH) #if 0 #define DEBUGF(x...) printf(x) @@ -783,4 +783,4 @@ unsigned long flash_init(void) return total_b; } -#endif /* ifdef CONFIG_CAM5200 */ +#endif /* if defined(CONFIG_CAM5200) && defined(CONFIG_CAM5200_NIOSFLASH) */ diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index 08674ca49f5..15906a0a379 100644 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -325,15 +325,7 @@ */ #define CFG_FLASH_BASE 0xFC000000 -#ifndef CONFIG_CAM5200 -/* use CFI flash driver */ -#define CFG_FLASH_CFI 1 /* Flash is CFI conformant */ -#define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */ -#define CFG_FLASH_BANKS_LIST { CFG_BOOTCS_START } -#define CFG_MAX_FLASH_BANKS 1 /* max num of flash banks - (= chip selects) */ -#define CFG_MAX_FLASH_SECT 512 /* max num of sects on one chip */ -#else /* CONFIG_CAM5200 */ +#if defined(CONFIG_CAM5200) && defined(CONFIG_CAM5200_NIOSFLASH) #define CFG_MAX_FLASH_BANKS 2 /* max num of flash banks (= chip selects) */ #define CFG_FLASH_WORD_SIZE unsigned int /* main flash device with */ @@ -344,7 +336,15 @@ #define CFG_FLASH_ADDR1 0x2AA #define CFG_FLASH_2ND_16BIT_DEV 1 /* NIOS flash is a 16bit device */ #define CFG_MAX_FLASH_SECT 128 -#endif /* ifndef CONFIG_CAM5200 */ +#else +/* use CFI flash driver */ +#define CFG_FLASH_CFI 1 /* Flash is CFI conformant */ +#define CFG_FLASH_CFI_DRIVER 1 /* Use the common driver */ +#define CFG_FLASH_BANKS_LIST { CFG_BOOTCS_START } +#define CFG_MAX_FLASH_BANKS 1 /* max num of flash banks + (= chip selects) */ +#define CFG_MAX_FLASH_SECT 512 /* max num of sects on one chip */ +#endif #define CFG_FLASH_EMPTY_INFO #define CFG_FLASH_SIZE 0x04000000 /* 64 MByte */ -- cgit v1.3.1 From 6abaee42621c07e81a2cd189ad4368b5e8c50280 Mon Sep 17 00:00:00 2001 From: Reinhard Thies Date: Wed, 10 Jan 2007 14:41:14 +0100 Subject: Adjusted default environment for cam5200 board. --- include/configs/TQM5200.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index 15906a0a379..7069b35ad60 100644 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -231,6 +231,17 @@ "protect on FC000000 +${filesize}\0" #endif +#ifndef CONFIG_CAM5200 +#define CUSTOM_ENV_SETTINGS \ + "bootfile=/tftpboot/tqm5200/uImage\0" \ + "u-boot=/tftpboot/tqm5200/u-boot.bin\0" +#else +#define CUSTOM_ENV_SETTINGS \ + "bootfile=cam5200/uImage\0" \ + "u-boot=cam5200/u-boot.bin\0" \ + "setup=tftp 200000 cam5200/setup.img; autoscr 200000\0" +#endif + #define CONFIG_EXTRA_ENV_SETTINGS \ "netdev=eth0\0" \ "rootpath=/opt/eldk/ppc_6xx\0" \ @@ -248,8 +259,7 @@ "bootm ${kernel_addr}\0" \ "net_nfs=tftp 200000 ${bootfile};run nfsargs addip addcons;" \ "bootm\0" \ - "bootfile=/tftpboot/tqm5200/uImage\0" \ - "u-boot=/tftpboot/tqm5200/u-boot.bin\0" \ + CUSTOM_ENV_SETTINGS \ "load=tftp 200000 ${u-boot}\0" \ ENV_UPDT \ "" -- cgit v1.3.1