diff options
Diffstat (limited to 'roms/u-boot/board/manroland/uc100')
| -rw-r--r-- | roms/u-boot/board/manroland/uc100/Makefile | 8 | ||||
| -rw-r--r-- | roms/u-boot/board/manroland/uc100/pcmcia.c | 192 | ||||
| -rw-r--r-- | roms/u-boot/board/manroland/uc100/u-boot.lds | 85 | ||||
| -rw-r--r-- | roms/u-boot/board/manroland/uc100/uc100.c | 254 | 
4 files changed, 539 insertions, 0 deletions
diff --git a/roms/u-boot/board/manroland/uc100/Makefile b/roms/u-boot/board/manroland/uc100/Makefile new file mode 100644 index 00000000..8e69c52d --- /dev/null +++ b/roms/u-boot/board/manroland/uc100/Makefile @@ -0,0 +1,8 @@ +# +# (C) Copyright 2000-2006 +# Wolfgang Denk, DENX Software Engineering, wd@denx.de. +# +# SPDX-License-Identifier:	GPL-2.0+ +# + +obj-y	= uc100.o pcmcia.o diff --git a/roms/u-boot/board/manroland/uc100/pcmcia.c b/roms/u-boot/board/manroland/uc100/pcmcia.c new file mode 100644 index 00000000..db3821a5 --- /dev/null +++ b/roms/u-boot/board/manroland/uc100/pcmcia.c @@ -0,0 +1,192 @@ +#include <common.h> +#include <mpc8xx.h> +#include <pcmcia.h> + +#undef	CONFIG_PCMCIA + +#if defined(CONFIG_CMD_PCMCIA) +#define	CONFIG_PCMCIA +#endif + +#if (defined(CONFIG_CMD_IDE)) && defined(CONFIG_IDE_8xx_PCCARD) +#define	CONFIG_PCMCIA +#endif + +#ifdef	CONFIG_PCMCIA + +#define PCMCIA_BOARD_MSG "UC100" + +/* + * Remark: don't turn off OE "__MY_PCMCIA_GCRX_CXOE" on UC100 board. + *         This leads to board-hangup! (sr, 8 Dez. 2004) + */ +static void cfg_ports (void) +{ +	volatile immap_t	*immap; + +	immap = (immap_t *)CONFIG_SYS_IMMR; + +	/* +	 * Configure Port A for MAX1602 PC-Card Power-Interface Switch +	 */ +	immap->im_ioport.iop_padat &= ~0x8000;	/* set port x output to low */ +	immap->im_ioport.iop_padir |= 0x8000;	/* enable port x as output */ + +	debug ("Set Port A: PAR: %08x DIR: %08x DAT: %08x\n", +	       immap->im_ioport.iop_papar, immap->im_ioport.iop_padir, +	       immap->im_ioport.iop_padat); +} + +int pcmcia_hardware_enable(int slot) +{ +	volatile immap_t	*immap; +	volatile pcmconf8xx_t	*pcmp; +	volatile sysconf8xx_t	*sysp; +	uint reg, mask; + +	debug ("hardware_enable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + +	udelay(10000); + +	immap = (immap_t *)CONFIG_SYS_IMMR; +	sysp  = (sysconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_siu_conf)); +	pcmp  = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia)); + +	/* Configure Ports for TPS2211A PC-Card Power-Interface Switch */ +	cfg_ports (); + +	/* +	 * Configure SIUMCR to enable PCMCIA port B +	 * (VFLS[0:1] are not used for debugging, we connect FRZ# instead) +	 */ +	sysp->sc_siumcr &= ~SIUMCR_DBGC11;	/* set DBGC to 00 */ + +	/* clear interrupt state, and disable interrupts */ +	pcmp->pcmc_pscr =  PCMCIA_MASK(_slot_); +	pcmp->pcmc_per &= ~PCMCIA_MASK(_slot_); + +	/* +	 * Disable interrupts, DMA, and PCMCIA buffers +	 * (isolate the interface) and assert RESET signal +	 */ +	debug ("Disable PCMCIA buffers and assert RESET\n"); +	reg  = 0; +	reg |= __MY_PCMCIA_GCRX_CXRESET;	/* active high */ +	PCMCIA_PGCRX(_slot_) = reg; +	udelay(500); + +	/* +	 * Make sure there is a card in the slot, then configure the interface. +	 */ +	udelay(10000); +	debug ("[%d] %s: PIPR(%p)=0x%x\n", +	       __LINE__,__FUNCTION__, +	       &(pcmp->pcmc_pipr),pcmp->pcmc_pipr); +	if (pcmp->pcmc_pipr & (0x18000000 >> (slot << 4))) { +		printf ("   No Card found\n"); +		return (1); +	} + +	/* +	 * Power On. +	 */ +	mask = PCMCIA_VS1(slot) | PCMCIA_VS2(slot); +	reg  = pcmp->pcmc_pipr; +	debug ("PIPR: 0x%x ==> VS1=o%s, VS2=o%s\n", +	       reg, +	       (reg&PCMCIA_VS1(slot))?"n":"ff", +	       (reg&PCMCIA_VS2(slot))?"n":"ff"); + +	if ((reg & mask) == mask) +		puts (" 5.0V card found: "); +	else +		puts (" 3.3V card found: "); + +	/*  switch VCC on */ +	immap->im_ioport.iop_padat |= 0x8000; /* power enable 3.3V */ + +	udelay(10000); + +	debug ("Enable PCMCIA buffers and stop RESET\n"); +	reg  =  PCMCIA_PGCRX(_slot_); +	reg &= ~__MY_PCMCIA_GCRX_CXRESET;	/* active high */ +	reg &= ~__MY_PCMCIA_GCRX_CXOE;		/* active low  */ +	PCMCIA_PGCRX(_slot_) = reg; + +	udelay(250000);	/* some cards need >150 ms to come up :-( */ + +	debug ("# hardware_enable done\n"); + +	return (0); +} + + +#if defined(CONFIG_CMD_PCMCIA) +int pcmcia_hardware_disable(int slot) +{ +	volatile immap_t	*immap; +	volatile cpm8xx_t	*cp; +	volatile pcmconf8xx_t	*pcmp; +	u_long reg; + +	debug ("hardware_disable: " PCMCIA_BOARD_MSG " Slot %c\n", 'A'+slot); + +	immap = (immap_t *)CONFIG_SYS_IMMR; +	pcmp  = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia)); + +	/* switch VCC off */ +	immap->im_ioport.iop_padat &= ~0x8000; /* power disable 3.3V */ + +	/* Configure PCMCIA General Control Register */ +	debug ("Disable PCMCIA buffers and assert RESET\n"); +	reg  = 0; +	reg |= __MY_PCMCIA_GCRX_CXRESET;	/* active high */ +	PCMCIA_PGCRX(_slot_) = reg; + +	udelay(10000); + +	return (0); +} +#endif + + +int pcmcia_voltage_set(int slot, int vcc, int vpp) +{ +	u_long reg; + +	debug ("voltage_set: " +			PCMCIA_BOARD_MSG +			" Slot %c, Vcc=%d.%d, Vpp=%d.%d\n", +	'A'+slot, vcc/10, vcc%10, vpp/10, vcc%10); + +	/* +	 * Disable PCMCIA buffers (isolate the interface) +	 * and assert RESET signal +	 */ +	debug ("Disable PCMCIA buffers and assert RESET\n"); +	reg  = PCMCIA_PGCRX(_slot_); +	reg |= __MY_PCMCIA_GCRX_CXRESET;	/* active high */ +	PCMCIA_PGCRX(_slot_) = reg; +	udelay(500); + +	/* +	 * Configure Port C pins for +	 * 5 Volts Enable and 3 Volts enable, +	 * Turn all power pins to Hi-Z +	 */ +	debug ("PCMCIA power OFF\n"); +	cfg_ports ();	/* Enables switch, but all in Hi-Z */ + +	debug ("Enable PCMCIA buffers and stop RESET\n"); +	reg  =  PCMCIA_PGCRX(_slot_); +	reg &= ~__MY_PCMCIA_GCRX_CXRESET;	/* active high */ +	reg &= ~__MY_PCMCIA_GCRX_CXOE;		/* active low  */ +	PCMCIA_PGCRX(_slot_) = reg; +	udelay(500); + +	debug ("voltage_set: " PCMCIA_BOARD_MSG " Slot %c, DONE\n", +	       slot+'A'); +	return (0); +} + +#endif	/* CONFIG_PCMCIA */ diff --git a/roms/u-boot/board/manroland/uc100/u-boot.lds b/roms/u-boot/board/manroland/uc100/u-boot.lds new file mode 100644 index 00000000..47f2de8e --- /dev/null +++ b/roms/u-boot/board/manroland/uc100/u-boot.lds @@ -0,0 +1,85 @@ +/* + * (C) Copyright 2000 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +OUTPUT_ARCH(powerpc) + +SECTIONS +{ +  /* Read-only sections, merged into text segment: */ +  . = + SIZEOF_HEADERS; +  .text      : +  { +    /* WARNING - the following is hand-optimized to fit within	*/ +    /* the sector layout of our flash chips!	XXX FIXME XXX	*/ + +    arch/powerpc/cpu/mpc8xx/start.o	(.text*) +    arch/powerpc/cpu/mpc8xx/traps.o	(.text*) + +    *(.text*) +  } +  _etext = .; +  PROVIDE (etext = .); +  .rodata    : +  { +    *(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*))) +  } + +  /* Read-write section, merged into data segment: */ +  . = (. + 0x00FF) & 0xFFFFFF00; +  _erotext = .; +  PROVIDE (erotext = .); +  .reloc   : +  { +    _GOT2_TABLE_ = .; +    KEEP(*(.got2)) +    KEEP(*(.got)) +    PROVIDE(_GLOBAL_OFFSET_TABLE_ = . + 4); +    _FIXUP_TABLE_ = .; +    KEEP(*(.fixup)) +  } +  __got2_entries = ((_GLOBAL_OFFSET_TABLE_ - _GOT2_TABLE_) >> 2) - 1; +  __fixup_entries = (. - _FIXUP_TABLE_)>>2; + +  .data    : +  { +    *(.data*) +    *(.sdata*) +  } +  _edata  =  .; +  PROVIDE (edata = .); + +  . = .; + +  . = ALIGN(4); +  .u_boot_list : { +	KEEP(*(SORT(.u_boot_list*))); +  } + + +  . = .; +  __start___ex_table = .; +  __ex_table : { *(__ex_table) } +  __stop___ex_table = .; + +  . = ALIGN(256); +  __init_begin = .; +  .text.init : { *(.text.init) } +  .data.init : { *(.data.init) } +  . = ALIGN(256); +  __init_end = .; + +  __bss_start = .; +  .bss (NOLOAD)       : +  { +   *(.bss*) +   *(.sbss*) +   *(COMMON) +   . = ALIGN(4); +  } +  __bss_end = . ; +  PROVIDE (end = .); +} diff --git a/roms/u-boot/board/manroland/uc100/uc100.c b/roms/u-boot/board/manroland/uc100/uc100.c new file mode 100644 index 00000000..31f08dda --- /dev/null +++ b/roms/u-boot/board/manroland/uc100/uc100.c @@ -0,0 +1,254 @@ +/* + * (C) Copyright 2000-2004 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * SPDX-License-Identifier:	GPL-2.0+ + */ + +#if 0 +#define DEBUG +#endif + +#include <common.h> +#include <mpc8xx.h> +#include <i2c.h> +#include <miiphy.h> + +int fec8xx_miiphy_write(char *devname, unsigned char  addr, +		unsigned char  reg, unsigned short value); + +/*********************************************************************/ +/* UPMA Pre Initilization Table by WV (Miron MT48LC16M16A2-7E B)     */ +/*********************************************************************/ +const uint sdram_init_upm_table[] = { +	/* SDRAM Initialisation Sequence (offset 0 in UPMA RAM) WV */ +	/* NOP    - Precharge - AutoRefr  - NOP       - NOP        */ +	/* NOP    - AutoRefr  - NOP                                */ +	/* NOP    - NOP       - LoadModeR - NOP       - Active     */ +	/* Position of Single Read                                 */ +	0x0ffffc04, 0x0ff77c04, 0x0ff5fc04, 0x0ffffc04, 0x0ffffc04, +	0x0ffffc04, 0x0ff5fc04, 0x0ffffc04, + +	/* Burst Read. (offset 8 in UPMA RAM)     */ +	/* Cycle lent for Initialisation WV */ +	0x0ffffc04, 0x0ffffc34, 0x0f057c34, 0x0ffffc30, 0x1ff7fc05, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* Single Write. (offset 18 in UPMA RAM) */ +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* Burst Write. (offset 20 in UPMA RAM) */ +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* Refresh  (offset 30 in UPMA RAM) */ +	0x0FF77C04, 0x0FFFFC04, 0x0FF5FC84, 0x0FFFFC04, 0x0FFFFC04, +	0x0FFFFC84, 0x1FFFFC05, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, + +	/* Exception. (offset 3c in UPMA RAM) */ +	0x7FFFFC05, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +}; + +/*********************************************************************/ +/* UPMA initilization table.                                         */ +/*********************************************************************/ +const uint sdram_upm_table[] = { +	/* single read. (offset 0 in UPMA RAM) */ +	0x0F07FC04, 0x0FFFFC04, 0x00BDFC04, 0x0FF77C00, 0x1FFFFC05, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF,     /* 0x05-0x07 new WV */ + +	/* Burst Read. (offset 8 in UPMA RAM) */ +	0x0F07FC04, 0x0FFFFC04, 0x00BDFC04, 0x00FFFC00, 0x00FFFC00, +	0x00FFFC00, 0x0FF77C00, 0x1FFFFC05, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* Single Write. (offset 18 in UPMA RAM) */ +	0x0F07FC04, 0x0FFFFC00, 0x00BD7C04, 0x0FFFFC04, 0x0FF77C04, +	0x1FFFFC05, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* Burst Write. (offset 20 in UPMA RAM) */ +	0x0F07FC04, 0x0FFFFC00, 0x00BD7C00, 0x00FFFC00, 0x00FFFC00, +	0x00FFFC04, 0x0FFFFC04, 0x0FF77C04, 0x1FFFFC05, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* Refresh  (offset 30 in UPMA RAM) */ +	0x0FF77C04, 0x0FFFFC04, 0x0FF5FC84, 0x0FFFFC04, 0x0FFFFC04, +	0x0FFFFC84, 0x1FFFFC05, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, + +	/* Exception. (offset 3c in UPMA RAM) */ +	0x7FFFFC05, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, /* 0x3C new WV */ +}; + +/*********************************************************************/ +/* UPMB initilization table.                                         */ +/*********************************************************************/ +const uint mpm_upm_table[] = { +	/*  single read. (offset 0 in upm RAM) */ +	0x8FF00004, 0x0FF00004, 0x0FF81004, 0x1FF00001, +	0x1FF00001, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* burst read. (Offset 8 in upm RAM)   */ +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* single write. (Offset 0x18 in upm RAM) */ +	0x8FF00004, 0x0FF00004, 0x0FF81004, 0x0FF00004, +	0x0FF00004, 0x1FF00001, 0xFFFFFFFF, 0xFFFFFFFF, + +	/*  burst write. (Offset 0x20 in upm RAM) */ +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* Refresh cycle, offset 0x30 */ +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, + +	/* Exception, 0ffset 0x3C */ +	0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, +}; + + +int board_switch(void) +{ +	volatile pcmconf8xx_t	*pcmp; + +	pcmp  = (pcmconf8xx_t *)(&(((immap_t *)CONFIG_SYS_IMMR)->im_pcmcia)); + +	return ((pcmp->pcmc_pipr >> 24) & 0xf); +} + + +/* + * Check Board Identity: + */ +int checkboard (void) +{ +	char str[64]; +	int i = getenv_f("serial#", str, sizeof(str)); + +	puts ("Board: "); + +	if (i == -1) { +		puts ("### No HW ID - assuming UC100"); +	} else { +		puts(str); +	} + +	printf (" (SWITCH=%1X)\n", board_switch()); + +	return 0; +} + + +/* + * Initialize SDRAM + */ +phys_size_t initdram (int board_type) +{ +	volatile immap_t *immap = (immap_t *) CONFIG_SYS_IMMR; +	volatile memctl8xx_t *memctl = &immap->im_memctl; + +	/*---------------------------------------------------------------------*/ +	/* Initialize the UPMA/UPMB registers with the appropriate table.      */ +	/*---------------------------------------------------------------------*/ +	upmconfig (UPMA, (uint *) sdram_init_upm_table, +		   sizeof (sdram_init_upm_table) / sizeof (uint)); +	upmconfig (UPMB, (uint *) mpm_upm_table, +		   sizeof (mpm_upm_table) / sizeof (uint)); + +	/*---------------------------------------------------------------------*/ +	/* Memory Periodic Timer Prescaler: divide by 16                       */ +	/*---------------------------------------------------------------------*/ +	memctl->memc_mptpr = 0x0200; /* Divide by 32 WV */ + +	memctl->memc_mamr = CONFIG_SYS_MAMR_VAL & 0xFF7FFFFF; /* Bit 8 := "0" Kein Refresh WV */ +	memctl->memc_mbmr = CONFIG_SYS_MBMR_VAL; + +	/*---------------------------------------------------------------------*/ +	/* Initialize the Memory Controller registers, MPTPR, Chip Select 1    */ +	/* for SDRAM                                                           */ +	/*                                                                     */ +	/* NOTE: The refresh rate in MAMR reg is set according to the lowest   */ +	/*       clock rate (16.67MHz) to allow proper operation for all ADS   */ +	/*       clock frequencies.                                            */ +	/*---------------------------------------------------------------------*/ +	memctl->memc_or1 = CONFIG_SYS_OR1_PRELIM; +	memctl->memc_br1 = CONFIG_SYS_BR1_PRELIM; + +	/*-------------------------------------------------------------------*/ +	/* Wait at least 200 usec for DRAM to stabilize, this magic number   */ +	/* obtained from the init code.                                      */ +	/*-------------------------------------------------------------------*/ +	udelay(200); + +	memctl->memc_mamr = (memctl->memc_mamr | 0x04) & ~0x08; + +	memctl->memc_br1 = CONFIG_SYS_BR1_PRELIM; +	memctl->memc_or1 = CONFIG_SYS_OR1_PRELIM; + +	/*---------------------------------------------------------------------*/ +	/* run MRS command in location 5-8 of UPMB.                            */ +	/*---------------------------------------------------------------------*/ +	memctl->memc_mar = 0x88; +	/* RUN UPMA on CS1 1-time from UPMA addr 0x05 */ + +	memctl->memc_mcr = 0x80002100; +	/* RUN UPMA on CS1 1-time from UPMA addr 0x00 WV */ + +	udelay(200); + +	/*---------------------------------------------------------------------*/ +	/* Initialisation for normal access WV                                 */ +	/*---------------------------------------------------------------------*/ + +	/*---------------------------------------------------------------------*/ +	/* Initialize the UPMA register with the appropriate table.            */ +	/*---------------------------------------------------------------------*/ +	upmconfig (UPMA, (uint *) sdram_upm_table, +		   sizeof (sdram_upm_table) / sizeof (uint)); + +	/*---------------------------------------------------------------------*/ +	/* rerstore MBMR value (4-beat refresh burst.)                         */ +	/*---------------------------------------------------------------------*/ +	memctl->memc_mamr = CONFIG_SYS_MAMR_VAL | 0x00800000; /* Bit 8 := "1" Refresh Enable WV */ + +	udelay(200); + +	return (64 * 1024 * 1024); /* fixed setup for 64MBytes! */ +} + + +int misc_init_r (void) +{ +	uchar val; + +	/* +	 * Make sure that RTC has clock output enabled (triggers watchdog!) +	 */ +	val = i2c_reg_read (CONFIG_SYS_I2C_RTC_ADDR, 0x0D); +	val |= 0x80; +	i2c_reg_write (CONFIG_SYS_I2C_RTC_ADDR, 0x0D, val); + +	/* +	 * Configure PHY to setup LED's correctly and use 100MBit, FD +	 */ +	mii_init(); + +	/* disable auto-negotiation, 100mbit, full-duplex */ +	fec8xx_miiphy_write(NULL, 0, MII_BMCR, 0x2100); + +	/* set LED's to Link, Transmit, Receive           */ +	fec8xx_miiphy_write(NULL,  0, MII_NWAYTEST, 0x4122); + +	return 0; +}  | 
