From: Simon Glass Date: Fri, 4 Aug 2017 16:34:36 -0600 Subject: [U-Boot] [PATCH v2 12/42] Kconfig; Drop CONFIG_IDE_TI_CARDBUS and associated driver In-Reply-To: <20170804223506.105306-1-sjg@chromium.org> References: <20170804223506.105306-1-sjg@chromium.org> Message-ID: <20170804223506.105306-13-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: u-boot@lists.denx.de This driver is not used by any board. Drop it. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- Changes in v2: None drivers/pcmcia/Makefile | 1 - drivers/pcmcia/ti_pci1410a.c | 623 ---------------------------------------= ---- 2 files changed, 624 deletions(-) delete mode 100644 drivers/pcmcia/ti_pci1410a.c diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index b7e6188429..7d8cb5cb4c 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile @@ -5,5 +5,4 @@ # SPDX-License-Identifier: GPL-2.0+ # =20 -obj-$(CONFIG_IDE_TI_CARDBUS) +=3D ti_pci1410a.o obj-$(CONFIG_MARUBUN_PCCARD) +=3D marubun_pcmcia.o diff --git a/drivers/pcmcia/ti_pci1410a.c b/drivers/pcmcia/ti_pci1410a.c deleted file mode 100644 index d83db3f022..0000000000 --- a/drivers/pcmcia/ti_pci1410a.c +++ /dev/null @@ -1,623 +0,0 @@ -/* - * (C) Copyright 2000-2002 - * Wolfgang Denk, DENX Software Engineering, wd at denx.de. - * (C) Copyright 2002 - * Daniel Engstr=C3=B6m, Omicron Ceti AB - * - * SPDX-License-Identifier: GPL-2.0+ - * - ******************************************************************** - * - * Lots of code copied from: - * - * m8xx_pcmcia.c - Linux PCMCIA socket driver for the mpc8xx series. - * (C) 1999-2000 Magnus Damm - * - * "The ExCA standard specifies that socket controllers should provide - * two IO and five memory windows per socket, which can be independently - * configured and positioned in the host address space and mapped to - * arbitrary segments of card address space. " - David A Hinds. 1999 - * - * This controller does _not_ meet the ExCA standard. - * - * m8xx pcmcia controller brief info: - * + 8 windows (attrib, mem, i/o) - * + up to two slots (SLOT_A and SLOT_B) - * + inputpins, outputpins, event and mask registers. - * - no offset register. sigh. - * - * Because of the lacking offset register we must map the whole card. - * We assign each memory window PCMCIA_MEM_WIN_SIZE address space. - * Make sure there is (PCMCIA_MEM_WIN_SIZE * PCMCIA_MEM_WIN_NO - * * PCMCIA_SOCKETS_NO) bytes at PCMCIA_MEM_WIN_BASE. - * The i/o windows are dynamically allocated at PCMCIA_IO_WIN_BASE. - * They are maximum 64KByte each... - */ - - -#undef DEBUG /**/ - -/* - * PCMCIA support - */ -#include -#include -#include -#include -#include - -#include - -#if defined(CONFIG_CMD_PCMCIA) - -int pcmcia_on(int ide_base_bus); - -static int hardware_disable(int slot); -static int hardware_enable(int slot); -static int voltage_set(int slot, int vcc, int vpp); -static void print_funcid(int func); -static void print_fixed(volatile char *p); -static int identify(volatile char *p); -static int check_ide_device(int slot, int ide_base_bus); - - -/* -----------------------------------------------------------------------= -- */ - - -const char *indent =3D "\t "; - -/* -----------------------------------------------------------------------= -- */ - - -static struct pci_device_id supported[] =3D { - { PCI_VENDOR_ID_TI, 0xac50 }, /* Ti PCI1410A */ - { PCI_VENDOR_ID_TI, 0xac56 }, /* Ti PCI1510 */ - { } -}; - -static pci_dev_t devbusfn; -static u32 socket_base; -static u32 pcmcia_cis_ptr; - -int pcmcia_on(int ide_base_bus) -{ - u16 dev_id; - u32 socket_status; - int slot =3D 0; - int cis_len; - u16 io_base; - u16 io_len; - - /* - * Find the CardBus PCI device(s). - */ - if ((devbusfn =3D pci_find_devices(supported, 0)) < 0) { - printf("Ti CardBus: not found\n"); - return 1; - } - - pci_read_config_word(devbusfn, PCI_DEVICE_ID, &dev_id); - - if (dev_id =3D=3D 0xac56) { - debug("Enable PCMCIA Ti PCI1510\n"); - } else { - debug("Enable PCMCIA Ti PCI1410A\n"); - } - - pcmcia_cis_ptr =3D CONFIG_SYS_PCMCIA_CIS_WIN; - cis_len =3D CONFIG_SYS_PCMCIA_CIS_WIN_SIZE; - - io_base =3D CONFIG_SYS_PCMCIA_IO_WIN; - io_len =3D CONFIG_SYS_PCMCIA_IO_WIN_SIZE; - - /* - * Setup the PCI device. - */ - pci_read_config_dword(devbusfn, PCI_BASE_ADDRESS_0, &socket_base); - socket_base &=3D ~0xf; - - socket_status =3D readl(socket_base+8); - if ((socket_status & 6) =3D=3D 0) { - printf("Card Present: "); - - switch (socket_status & 0x3c00) { - - case 0x400: - printf("5V "); - break; - case 0x800: - printf("3.3V "); - break; - case 0xc00: - printf("3.3/5V "); - break; - default: - printf("unsupported Vcc "); - break; - } - switch (socket_status & 0x30) { - case 0x10: - printf("16bit PC-Card\n"); - break; - case 0x20: - printf("32bit CardBus Card\n"); - break; - default: - printf("8bit PC-Card\n"); - break; - } - } - - - writeb(0x41, socket_base + 0x806); /* Enable I/O window 0 and memory wind= ow 0 */ - writeb(0x0e, socket_base + 0x807); /* Reset I/O window options */ - - /* Careful: the linux yenta driver do not seem to reset the offset - * in the i/o windows, so leaving them non-zero is a problem */ - - writeb(io_base & 0xff, socket_base + 0x808); /* I/O window 0 base address= */ - writeb(io_base>>8, socket_base + 0x809); - writeb((io_base + io_len - 1) & 0xff, socket_base + 0x80a); /* I/O window= 0 end address */ - writeb((io_base + io_len - 1)>>8, socket_base + 0x80b); - writeb(0x00, socket_base + 0x836); /* I/O window 0 offset address 0x= 000 */ - writeb(0x00, socket_base + 0x837); - - - writeb((pcmcia_cis_ptr&0x000ff000) >> 12, - socket_base + 0x810); /* Memory window 0 start address bits 19-12 = */ - writeb((pcmcia_cis_ptr&0x00f00000) >> 20, - socket_base + 0x811); /* Memory window 0 start address bits 23-20= */ - writeb(((pcmcia_cis_ptr+cis_len-1) & 0x000ff000) >> 12, - socket_base + 0x812); /* Memory window 0 end address bits 19-12*/ - writeb(((pcmcia_cis_ptr+cis_len-1) & 0x00f00000) >> 20, - socket_base + 0x813); /* Memory window 0 end address bits 23-20*/ - writeb(0x00, socket_base + 0x814); /* Memory window 0 offset bits 19-12 */ - writeb(0x40, socket_base + 0x815); /* Memory window 0 offset bits 23-20 a= nd - * options (read/write, attribute access) */ - writeb(0x00, socket_base + 0x816); /* ExCA card-detect and general contro= l */ - writeb(0x00, socket_base + 0x81e); /* ExCA global control (interrupt mode= s) */ - - writeb((pcmcia_cis_ptr & 0xff000000) >> 24, - socket_base + 0x840); /* Memory window address bits 31-24 */ - - - /* turn off voltage */ - if (voltage_set(slot, 0, 0)) { - return 1; - } - - /* Enable external hardware */ - if (hardware_enable(slot)) { - return 1; - } - - if (check_ide_device(slot, ide_base_bus)) { - return 1; - } - - return 0; -} - -/* -----------------------------------------------------------------------= -- */ - - -#if defined(CONFIG_CMD_PCMCIA) -int pcmcia_off (void) -{ - int slot =3D 0; - - writeb(0x00, socket_base + 0x806); /* disable all I/O and memory windows = */ - - writeb(0x00, socket_base + 0x808); /* I/O window 0 base address */ - writeb(0x00, socket_base + 0x809); - writeb(0x00, socket_base + 0x80a); /* I/O window 0 end address */ - writeb(0x00, socket_base + 0x80b); - writeb(0x00, socket_base + 0x836); /* I/O window 0 offset address */ - writeb(0x00, socket_base + 0x837); - - writeb(0x00, socket_base + 0x80c); /* I/O window 1 base address */ - writeb(0x00, socket_base + 0x80d); - writeb(0x00, socket_base + 0x80e); /* I/O window 1 end address */ - writeb(0x00, socket_base + 0x80f); - writeb(0x00, socket_base + 0x838); /* I/O window 1 offset address */ - writeb(0x00, socket_base + 0x839); - - writeb(0x00, socket_base + 0x810); /* Memory window 0 start address */ - writeb(0x00, socket_base + 0x811); - writeb(0x00, socket_base + 0x812); /* Memory window 0 end address */ - writeb(0x00, socket_base + 0x813); - writeb(0x00, socket_base + 0x814); /* Memory window 0 offset */ - writeb(0x00, socket_base + 0x815); - - writeb(0xc0, socket_base + 0x840); /* Memory window 0 page address */ - - - /* turn off voltage */ - voltage_set(slot, 0, 0); - - /* disable external hardware */ - printf ("Shutdown and Poweroff Ti PCI1410A\n"); - hardware_disable(slot); - - return 0; -} - -#endif - -/* -----------------------------------------------------------------------= -- */ - - -#define MAX_TUPEL_SZ 512 -#define MAX_FEATURES 4 -int ide_devices_found; -static int check_ide_device(int slot, int ide_base_bus) -{ - volatile char *ident =3D NULL; - volatile char *feature_p[MAX_FEATURES]; - volatile char *p, *start; - int n_features =3D 0; - uchar func_id =3D ~0; - uchar code, len; - ushort config_base =3D 0; - int found =3D 0; - int i; - u32 socket_status; - - debug ("PCMCIA MEM: %08X\n", pcmcia_cis_ptr); - - socket_status =3D readl(socket_base+8); - - if ((socket_status & 6) !=3D 0 || (socket_status & 0x20) !=3D 0) { - printf("no card or CardBus card\n"); - return 1; - } - - start =3D p =3D (volatile char *) pcmcia_cis_ptr; - - while ((p - start) < MAX_TUPEL_SZ) { - - code =3D *p; p +=3D 2; - - if (code =3D=3D 0xFF) { /* End of chain */ - break; - } - - len =3D *p; p +=3D 2; -#if defined(DEBUG) && (DEBUG > 1) - { - volatile uchar *q =3D p; - printf ("\nTuple code %02x length %d\n\tData:", - code, len); - - for (i =3D 0; i < len; ++i) { - printf (" %02x", *q); - q+=3D 2; - } - } -#endif /* DEBUG */ - switch (code) { - case CISTPL_VERS_1: - ident =3D p + 4; - break; - case CISTPL_FUNCID: - /* Fix for broken SanDisk which may have 0x80 bit set */ - func_id =3D *p & 0x7F; - break; - case CISTPL_FUNCE: - if (n_features < MAX_FEATURES) - feature_p[n_features++] =3D p; - break; - case CISTPL_CONFIG: - config_base =3D (*(p+6) << 8) + (*(p+4)); - debug ("\n## Config_base =3D %04x ###\n", config_base); - default: - break; - } - p +=3D 2 * len; - } - - found =3D identify(ident); - - if (func_id !=3D ((uchar)~0)) { - print_funcid (func_id); - - if (func_id =3D=3D CISTPL_FUNCID_FIXED) - found =3D 1; - else - return 1; /* no disk drive */ - } - - for (i=3D0; i id_str) { - if (*t =3D=3D ' ') { - *t =3D '\0'; - } else { - break; - } - } - puts(id_str); - putc('\n'); - - for (card=3Dknown_cards; *card; ++card) { - debug ("## Compare against \"%s\"\n", *card); - if (strcmp(*card, id_str) =3D=3D 0) { /* found! */ - debug ("## CARD FOUND ##\n"); - return 1; - } - } - - return 0; /* don't know */ -} - -#endif /* CONFIG_CMD_PCMCIA */ --=20 2.14.0.rc1.383.gd1ce394fe2-goog