From 8f3086aaac00749ce22be205ec01c97597a41b36 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Mon, 23 Jan 2017 13:31:23 -0700 Subject: powerpc: Drop CONFIG_SYS_ALLOC_DPRAM This is not defined anywhere in U-Boot. Drop this dead code. Signed-off-by: Simon Glass --- arch/powerpc/cpu/mpc8xx/Makefile | 1 - arch/powerpc/cpu/mpc8xx/commproc.c | 69 -------------------------------------- arch/powerpc/cpu/mpc8xx/fec.c | 10 ++---- arch/powerpc/cpu/mpc8xx/i2c.c | 10 ------ arch/powerpc/cpu/mpc8xx/scc.c | 10 ++---- arch/powerpc/cpu/mpc8xx/serial.c | 17 ++-------- arch/powerpc/cpu/mpc8xx/spi.c | 7 ---- 7 files changed, 6 insertions(+), 118 deletions(-) delete mode 100644 arch/powerpc/cpu/mpc8xx/commproc.c (limited to 'arch/powerpc/cpu/mpc8xx') diff --git a/arch/powerpc/cpu/mpc8xx/Makefile b/arch/powerpc/cpu/mpc8xx/Makefile index f83fd5ecf4..6f81fee571 100644 --- a/arch/powerpc/cpu/mpc8xx/Makefile +++ b/arch/powerpc/cpu/mpc8xx/Makefile @@ -10,7 +10,6 @@ extra-y += start.o extra-y += traps.o obj-y += bedbug_860.o -obj-y += commproc.o obj-y += cpu.o obj-y += cpu_init.o obj-y += fec.o diff --git a/arch/powerpc/cpu/mpc8xx/commproc.c b/arch/powerpc/cpu/mpc8xx/commproc.c deleted file mode 100644 index f8581d130d..0000000000 --- a/arch/powerpc/cpu/mpc8xx/commproc.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * (C) Copyright 2000-2002 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include -#include - -DECLARE_GLOBAL_DATA_PTR; - -#ifdef CONFIG_SYS_ALLOC_DPRAM - -int dpram_init (void) -{ - /* Reclaim the DP memory for our use. */ - gd->arch.dp_alloc_base = CPM_DATAONLY_BASE; - gd->arch.dp_alloc_top = CPM_DATAONLY_BASE + CPM_DATAONLY_SIZE; - - return (0); -} - -/* Allocate some memory from the dual ported ram. We may want to - * enforce alignment restrictions, but right now everyone is a good - * citizen. - */ -uint dpram_alloc (uint size) -{ - uint addr = gd->arch.dp_alloc_base; - - if ((gd->arch.dp_alloc_base + size) >= gd->arch.dp_alloc_top) - return (CPM_DP_NOSPACE); - - gd->arch.dp_alloc_base += size; - - return addr; -} - -uint dpram_base (void) -{ - return gd->arch.dp_alloc_base; -} - -/* Allocate some memory from the dual ported ram. We may want to - * enforce alignment restrictions, but right now everyone is a good - * citizen. - */ -uint dpram_alloc_align (uint size, uint align) -{ - uint addr, mask = align - 1; - - addr = (gd->arch.dp_alloc_base + mask) & ~mask; - - if ((addr + size) >= gd->arch.dp_alloc_top) - return (CPM_DP_NOSPACE); - - gd->arch.dp_alloc_base = addr + size; - - return addr; -} - -uint dpram_base_align (uint align) -{ - uint mask = align - 1; - - return (gd->arch.dp_alloc_base + mask) & ~mask; -} -#endif /* CONFIG_SYS_ALLOC_DPRAM */ diff --git a/arch/powerpc/cpu/mpc8xx/fec.c b/arch/powerpc/cpu/mpc8xx/fec.c index 0940906b1d..b27310fffb 100644 --- a/arch/powerpc/cpu/mpc8xx/fec.c +++ b/arch/powerpc/cpu/mpc8xx/fec.c @@ -570,14 +570,8 @@ static int fec_init (struct eth_device *dev, bd_t * bd) rxIdx = 0; txIdx = 0; - if (!rtx) { -#ifdef CONFIG_SYS_ALLOC_DPRAM - rtx = (RTXBD *) (immr->im_cpm.cp_dpmem + - dpram_alloc_align (sizeof (RTXBD), 8)); -#else - rtx = (RTXBD *) (immr->im_cpm.cp_dpmem + CPM_FEC_BASE); -#endif - } + if (!rtx) + rtx = (RTXBD *)(immr->im_cpm.cp_dpmem + CPM_FEC_BASE); /* * Setup Receiver Buffer Descriptors (13.14.24.18) * Settings: diff --git a/arch/powerpc/cpu/mpc8xx/i2c.c b/arch/powerpc/cpu/mpc8xx/i2c.c index 3dff4ab4ac..54d5cb5130 100644 --- a/arch/powerpc/cpu/mpc8xx/i2c.c +++ b/arch/powerpc/cpu/mpc8xx/i2c.c @@ -190,17 +190,7 @@ void i2c_init(int speed, int slaveaddr) iip->iic_rpbase = 0; #endif -#ifdef CONFIG_SYS_ALLOC_DPRAM - dpaddr = iip->iic_rbase; - if (dpaddr == 0) { - /* need to allocate dual port ram */ - dpaddr = dpram_alloc_align((NUM_RX_BDS * sizeof(I2C_BD)) + - (NUM_TX_BDS * sizeof(I2C_BD)) + - MAX_TX_SPACE, 8); - } -#else dpaddr = CPM_I2C_BASE; -#endif /* * initialise data in dual port ram: diff --git a/arch/powerpc/cpu/mpc8xx/scc.c b/arch/powerpc/cpu/mpc8xx/scc.c index 3474637fac..17bcc2fe0a 100644 --- a/arch/powerpc/cpu/mpc8xx/scc.c +++ b/arch/powerpc/cpu/mpc8xx/scc.c @@ -199,14 +199,8 @@ static int scc_init (struct eth_device *dev, bd_t * bis) rxIdx = 0; txIdx = 0; - if (!rtx) { -#ifdef CONFIG_SYS_ALLOC_DPRAM - rtx = (RTXBD *) (immr->im_cpm.cp_dpmem + - dpram_alloc_align (sizeof (RTXBD), 8)); -#else - rtx = (RTXBD *) (immr->im_cpm.cp_dpmem + CPM_SCC_BASE); -#endif - } + if (!rtx) + rtx = (RTXBD *)(immr->im_cpm.cp_dpmem + CPM_SCC_BASE); #if (defined(PA_ENET_RXD) && defined(PA_ENET_TXD)) /* Configure port A pins for Txd and Rxd. diff --git a/arch/powerpc/cpu/mpc8xx/serial.c b/arch/powerpc/cpu/mpc8xx/serial.c index 94c785f611..b6e12d0d85 100644 --- a/arch/powerpc/cpu/mpc8xx/serial.c +++ b/arch/powerpc/cpu/mpc8xx/serial.c @@ -176,15 +176,7 @@ static int smc_init (void) /* Set the physical address of the host memory buffers in * the buffer descriptors. */ - -#ifdef CONFIG_SYS_ALLOC_DPRAM - /* allocate - * size of struct serialbuffer with bd rx/tx, buffer rx/tx and rx index - */ - dpaddr = dpram_alloc_align((sizeof(serialbuffer_t)), 8); -#else - dpaddr = CPM_SERIAL_BASE ; -#endif + dpaddr = CPM_SERIAL_BASE; rtx = (serialbuffer_t *)&cp->cp_dpmem[dpaddr]; /* Allocate space for two buffer descriptors in the DP ram. @@ -421,12 +413,7 @@ static int scc_init (void) #endif /* Allocate space for two buffer descriptors in the DP ram. */ - -#ifdef CONFIG_SYS_ALLOC_DPRAM - dpaddr = dpram_alloc_align (sizeof(cbd_t)*2 + 2, 8) ; -#else - dpaddr = CPM_SERIAL2_BASE ; -#endif + dpaddr = dpram_alloc_align(sizeof(cbd_t)*2 + 2, 8); /* Enable SDMA. */ im->im_siu_conf.sc_sdcr = 0x0001; diff --git a/arch/powerpc/cpu/mpc8xx/spi.c b/arch/powerpc/cpu/mpc8xx/spi.c index 6267c0e204..35b425e7c1 100644 --- a/arch/powerpc/cpu/mpc8xx/spi.c +++ b/arch/powerpc/cpu/mpc8xx/spi.c @@ -187,14 +187,7 @@ void spi_init_f (void) spi->spi_tbc = 0; spi->spi_txtmp = 0; - /* Allocate space for one transmit and one receive buffer - * descriptor in the DP ram - */ -#ifdef CONFIG_SYS_ALLOC_DPRAM - dpaddr = dpram_alloc_align (sizeof(cbd_t)*2, 8); -#else dpaddr = CPM_SPI_BASE; -#endif /* 3 */ /* Set up the SPI parameters in the parameter ram */ -- cgit