diff options
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/arm/include/asm/arch-am33xx/hardware.h | 1 | ||||
| -rw-r--r-- | arch/arm/include/asm/arch-davinci/da8xx-fb.h | 113 | ||||
| -rw-r--r-- | arch/arm/include/asm/arch-exynos/mipi_dsim.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/arch-zynq/hardware.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/imx-common/dma.h | 2 | ||||
| -rw-r--r-- | arch/microblaze/lib/board.c | 5 | ||||
| -rw-r--r-- | arch/mips/include/asm/config.h | 3 | ||||
| -rw-r--r-- | arch/mips/lib/Makefile | 4 | ||||
| -rw-r--r-- | arch/mips/lib/bootm.c | 241 | ||||
| -rw-r--r-- | arch/mips/lib/bootm_qemu_mips.c | 62 | ||||
| -rw-r--r-- | arch/nds32/include/asm/dma-mapping.h | 33 | ||||
| -rw-r--r-- | arch/powerpc/cpu/mpc8xx/video.c | 1 | 
12 files changed, 204 insertions, 265 deletions
| diff --git a/arch/arm/include/asm/arch-am33xx/hardware.h b/arch/arm/include/asm/arch-am33xx/hardware.h index 02f5f8a8d..2dfcc2e65 100644 --- a/arch/arm/include/asm/arch-am33xx/hardware.h +++ b/arch/arm/include/asm/arch-am33xx/hardware.h @@ -78,4 +78,5 @@  #define USB0_OTG_BASE			0x47401000  #define USB1_OTG_BASE			0x47401800 +int clk_get(int clk);  #endif /* __AM33XX_HARDWARE_H */ diff --git a/arch/arm/include/asm/arch-davinci/da8xx-fb.h b/arch/arm/include/asm/arch-davinci/da8xx-fb.h deleted file mode 100644 index c115034f0..000000000 --- a/arch/arm/include/asm/arch-davinci/da8xx-fb.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Porting to u-boot: - * - * (C) Copyright 2011 - * Stefano Babic, DENX Software Engineering, sbabic@denx.de. - * - * Copyright (C) 2008-2009 MontaVista Software Inc. - * Copyright (C) 2008-2009 Texas Instruments Inc - * - * Based on the LCD driver for TI Avalanche processors written by - * Ajay Singh and Shalom Hai. - * - * SPDX-License-Identifier:	GPL-2.0+ - */ - -#ifndef DA8XX_FB_H -#define DA8XX_FB_H - -enum panel_type { -	QVGA = 0 -}; - -enum panel_shade { -	MONOCHROME = 0, -	COLOR_ACTIVE, -	COLOR_PASSIVE, -}; - -enum raster_load_mode { -	LOAD_DATA = 1, -	LOAD_PALETTE, -}; - -struct display_panel { -	enum panel_type panel_type; /* QVGA */ -	int max_bpp; -	int min_bpp; -	enum panel_shade panel_shade; -}; - -struct da8xx_panel { -	const char	name[25];	/* Full name <vendor>_<model> */ -	unsigned short	width; -	unsigned short	height; -	int		hfp;		/* Horizontal front porch */ -	int		hbp;		/* Horizontal back porch */ -	int		hsw;		/* Horizontal Sync Pulse Width */ -	int		vfp;		/* Vertical front porch */ -	int		vbp;		/* Vertical back porch */ -	int		vsw;		/* Vertical Sync Pulse Width */ -	unsigned int	pxl_clk;	/* Pixel clock */ -	unsigned char	invert_pxl_clk;	/* Invert Pixel clock */ -}; - -struct da8xx_lcdc_platform_data { -	const char manu_name[10]; -	void *controller_data; -	const char type[25]; -	void (*panel_power_ctrl)(int); -}; - -struct lcd_ctrl_config { -	const struct display_panel *p_disp_panel; - -	/* AC Bias Pin Frequency */ -	int ac_bias; - -	/* AC Bias Pin Transitions per Interrupt */ -	int ac_bias_intrpt; - -	/* DMA burst size */ -	int dma_burst_sz; - -	/* Bits per pixel */ -	int bpp; - -	/* FIFO DMA Request Delay */ -	int fdd; - -	/* TFT Alternative Signal Mapping (Only for active) */ -	unsigned char tft_alt_mode; - -	/* 12 Bit Per Pixel (5-6-5) Mode (Only for passive) */ -	unsigned char stn_565_mode; - -	/* Mono 8-bit Mode: 1=D0-D7 or 0=D0-D3 */ -	unsigned char mono_8bit_mode; - -	/* Invert line clock */ -	unsigned char invert_line_clock; - -	/* Invert frame clock  */ -	unsigned char invert_frm_clock; - -	/* Horizontal and Vertical Sync Edge: 0=rising 1=falling */ -	unsigned char sync_edge; - -	/* Horizontal and Vertical Sync: Control: 0=ignore */ -	unsigned char sync_ctrl; - -	/* Raster Data Order Select: 1=Most-to-least 0=Least-to-most */ -	unsigned char raster_order; -}; - -struct lcd_sync_arg { -	int back_porch; -	int front_porch; -	int pulse_width; -}; - -void da8xx_video_init(const struct da8xx_panel *panel, int bits_pixel); - -#endif  /* ifndef DA8XX_FB_H */ diff --git a/arch/arm/include/asm/arch-exynos/mipi_dsim.h b/arch/arm/include/asm/arch-exynos/mipi_dsim.h index 8916d9d16..498a9ffc0 100644 --- a/arch/arm/include/asm/arch-exynos/mipi_dsim.h +++ b/arch/arm/include/asm/arch-exynos/mipi_dsim.h @@ -291,7 +291,7 @@ struct exynos_platform_mipi_dsim {   */  struct mipi_dsim_master_ops {  	int (*cmd_write)(struct mipi_dsim_device *dsim, unsigned int data_id, -		unsigned int data0, unsigned int data1); +		const unsigned char *data0, unsigned int data1);  	int (*cmd_read)(struct mipi_dsim_device *dsim, unsigned int data_id,  		unsigned int data0, unsigned int data1);  	int (*get_dsim_frame_done)(struct mipi_dsim_device *dsim); diff --git a/arch/arm/include/asm/arch-zynq/hardware.h b/arch/arm/include/asm/arch-zynq/hardware.h index 25f0e3d9c..081624e20 100644 --- a/arch/arm/include/asm/arch-zynq/hardware.h +++ b/arch/arm/include/asm/arch-zynq/hardware.h @@ -17,6 +17,8 @@  #define ZYNQ_SDHCI_BASEADDR1		0xE0101000  #define ZYNQ_I2C_BASEADDR0		0xE0004000  #define ZYNQ_I2C_BASEADDR1		0xE0005000 +#define ZYNQ_SPI_BASEADDR0		0xE0006000 +#define ZYNQ_SPI_BASEADDR1		0xE0007000  /* Reflect slcr offsets */  struct slcr_regs { diff --git a/arch/arm/include/asm/imx-common/dma.h b/arch/arm/include/asm/imx-common/dma.h index 5f516ef6e..d5c1f7f25 100644 --- a/arch/arm/include/asm/imx-common/dma.h +++ b/arch/arm/include/asm/imx-common/dma.h @@ -161,4 +161,6 @@ void mxs_dma_init(void);  int mxs_dma_init_channel(int chan);  int mxs_dma_release(int chan); +void mxs_dma_circ_start(int chan, struct mxs_dma_desc *pdesc); +  #endif	/* __DMA_H__ */ diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c index 8267191fd..f7182f27e 100644 --- a/arch/microblaze/lib/board.c +++ b/arch/microblaze/lib/board.c @@ -16,6 +16,7 @@  #include <stdio_dev.h>  #include <serial.h>  #include <net.h> +#include <spi.h>  #include <linux/compiler.h>  #include <asm/processor.h>  #include <asm/microblaze_intc.h> @@ -147,6 +148,10 @@ void board_init_f(ulong not_used)  	}  #endif +#ifdef CONFIG_SPI +	spi_init(); +#endif +  	/* relocate environment function pointers etc. */  	env_relocate(); diff --git a/arch/mips/include/asm/config.h b/arch/mips/include/asm/config.h index cd2973478..3a891ba62 100644 --- a/arch/mips/include/asm/config.h +++ b/arch/mips/include/asm/config.h @@ -7,4 +7,7 @@  #ifndef _ASM_CONFIG_H_  #define _ASM_CONFIG_H_ +#define CONFIG_LMB +#define CONFIG_SYS_BOOT_RAMDISK_HIGH +  #endif diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index e9f82f711..f91406c06 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile @@ -19,11 +19,7 @@ LGOBJS	:= $(addprefix $(obj),$(GLSOBJS))  SOBJS-y	+=  COBJS-y	+= board.o -ifeq ($(CONFIG_QEMU_MIPS),y) -COBJS-$(CONFIG_CMD_BOOTM) += bootm_qemu_mips.o -else  COBJS-$(CONFIG_CMD_BOOTM) += bootm.o -endif  SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)  OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y)) diff --git a/arch/mips/lib/bootm.c b/arch/mips/lib/bootm.c index ade9af47e..66340ea47 100644 --- a/arch/mips/lib/bootm.c +++ b/arch/mips/lib/bootm.c @@ -17,23 +17,148 @@ DECLARE_GLOBAL_DATA_PTR;  #define	LINUX_MAX_ENVS		256  #define	LINUX_MAX_ARGS		256 +#if defined(CONFIG_QEMU_MALTA) +#define mips_boot_qemu_malta	1 +#else +#define mips_boot_qemu_malta	0 +#endif +  static int linux_argc;  static char **linux_argv; +static char *linux_argp;  static char **linux_env;  static char *linux_env_p;  static int linux_env_idx; -static void linux_params_init(ulong start, char *commandline); -static void linux_env_set(char *env_name, char *env_val); +static ulong arch_get_sp(void) +{ +	ulong ret; + +	__asm__ __volatile__("move %0, $sp" : "=r"(ret) : ); + +	return ret; +} + +void arch_lmb_reserve(struct lmb *lmb) +{ +	ulong sp; + +	sp = arch_get_sp(); +	debug("## Current stack ends at 0x%08lx\n", sp); + +	/* adjust sp by 4K to be safe */ +	sp -= 4096; +	lmb_reserve(lmb, sp, CONFIG_SYS_SDRAM_BASE + gd->ram_size - sp); +} + +static void linux_cmdline_init(void) +{ +	linux_argc = 1; +	linux_argv = (char **)UNCACHED_SDRAM(gd->bd->bi_boot_params); +	linux_argv[0] = 0; +	linux_argp = (char *)(linux_argv + LINUX_MAX_ARGS); +} + +static void linux_cmdline_set(const char *value, size_t len) +{ +	linux_argv[linux_argc] = linux_argp; +	memcpy(linux_argp, value, len); +	linux_argp[len] = 0; + +	linux_argp += len + 1; +	linux_argc++; +} + +static void linux_cmdline_dump(void) +{ +	int i; + +	debug("## cmdline argv at 0x%p, argp at 0x%p\n", +	      linux_argv, linux_argp); + +	for (i = 1; i < linux_argc; i++) +		debug("   arg %03d: %s\n", i, linux_argv[i]); +} + +static void boot_cmdline_linux(bootm_headers_t *images) +{ +	const char *bootargs, *next, *quote; + +	linux_cmdline_init(); + +	bootargs = getenv("bootargs"); +	if (!bootargs) +		return; + +	next = bootargs; + +	while (bootargs && *bootargs && linux_argc < LINUX_MAX_ARGS) { +		quote = strchr(bootargs, '"'); +		next = strchr(bootargs, ' '); + +		while (next && quote && quote < next) { +			/* +			 * we found a left quote before the next blank +			 * now we have to find the matching right quote +			 */ +			next = strchr(quote + 1, '"'); +			if (next) { +				quote = strchr(next + 1, '"'); +				next = strchr(next + 1, ' '); +			} +		} + +		if (!next) +			next = bootargs + strlen(bootargs); + +		linux_cmdline_set(bootargs, next - bootargs); + +		if (*next) +			next++; + +		bootargs = next; +	} + +	linux_cmdline_dump(); +} + +static void linux_env_init(void) +{ +	linux_env = (char **)(((ulong) linux_argp + 15) & ~15); +	linux_env[0] = 0; +	linux_env_p = (char *)(linux_env + LINUX_MAX_ENVS); +	linux_env_idx = 0; +} + +static void linux_env_set(const char *env_name, const char *env_val) +{ +	if (linux_env_idx < LINUX_MAX_ENVS - 1) { +		linux_env[linux_env_idx] = linux_env_p; + +		strcpy(linux_env_p, env_name); +		linux_env_p += strlen(env_name); + +		if (mips_boot_qemu_malta) { +			linux_env_p++; +			linux_env[++linux_env_idx] = linux_env_p; +		} else { +			*linux_env_p++ = '='; +		} + +		strcpy(linux_env_p, env_val); +		linux_env_p += strlen(env_val); + +		linux_env_p++; +		linux_env[++linux_env_idx] = 0; +	} +}  static void boot_prep_linux(bootm_headers_t *images)  { -	char *commandline = getenv("bootargs");  	char env_buf[12]; -	char *cp; - -	linux_params_init(UNCACHED_SDRAM(gd->bd->bi_boot_params), commandline); +	const char *cp; +	ulong rd_start, rd_size;  #ifdef CONFIG_MEMSIZE_IN_BYTES  	sprintf(env_buf, "%lu", (ulong)gd->ram_size); @@ -41,15 +166,20 @@ static void boot_prep_linux(bootm_headers_t *images)  #else  	sprintf(env_buf, "%lu", (ulong)(gd->ram_size >> 20));  	debug("## Giving linux memsize in MB, %lu\n", -		(ulong)(gd->ram_size >> 20)); +	      (ulong)(gd->ram_size >> 20));  #endif /* CONFIG_MEMSIZE_IN_BYTES */ +	rd_start = UNCACHED_SDRAM(images->initrd_start); +	rd_size = images->initrd_end - images->initrd_start; + +	linux_env_init(); +  	linux_env_set("memsize", env_buf); -	sprintf(env_buf, "0x%08X", (uint) UNCACHED_SDRAM(images->rd_start)); +	sprintf(env_buf, "0x%08lX", rd_start);  	linux_env_set("initrd_start", env_buf); -	sprintf(env_buf, "0x%X", (uint) (images->rd_end - images->rd_start)); +	sprintf(env_buf, "0x%lX", rd_size);  	linux_env_set("initrd_size", env_buf);  	sprintf(env_buf, "0x%08X", (uint) (gd->bd->bi_flashstart)); @@ -65,33 +195,42 @@ static void boot_prep_linux(bootm_headers_t *images)  	cp = getenv("eth1addr");  	if (cp)  		linux_env_set("eth1addr", cp); + +	if (mips_boot_qemu_malta) +		linux_env_set("modetty0", "38400n8r");  }  static void boot_jump_linux(bootm_headers_t *images)  { -	void (*theKernel) (int, char **, char **, int *); - -	/* find kernel entry point */ -	theKernel = (void (*)(int, char **, char **, int *))images->ep; +	typedef void __noreturn (*kernel_entry_t)(int, ulong, ulong, ulong); +	kernel_entry_t kernel = (kernel_entry_t) images->ep; +	ulong linux_extra = 0; -	debug("## Transferring control to Linux (at address %08lx) ...\n", -		(ulong) theKernel); +	debug("## Transferring control to Linux (at address %p) ...\n", kernel);  	bootstage_mark(BOOTSTAGE_ID_RUN_OS); +	if (mips_boot_qemu_malta) +		linux_extra = gd->ram_size; +  	/* we assume that the kernel is in place */  	printf("\nStarting kernel ...\n\n"); -	theKernel(linux_argc, linux_argv, linux_env, 0); +	kernel(linux_argc, (ulong)linux_argv, (ulong)linux_env, linux_extra);  }  int do_bootm_linux(int flag, int argc, char * const argv[],  			bootm_headers_t *images)  {  	/* No need for those on MIPS */ -	if (flag & BOOTM_STATE_OS_BD_T || flag & BOOTM_STATE_OS_CMDLINE) +	if (flag & BOOTM_STATE_OS_BD_T)  		return -1; +	if (flag & BOOTM_STATE_OS_CMDLINE) { +		boot_cmdline_linux(images); +		return 0; +	} +  	if (flag & BOOTM_STATE_OS_PREP) {  		boot_prep_linux(images);  		return 0; @@ -102,76 +241,10 @@ int do_bootm_linux(int flag, int argc, char * const argv[],  		return 0;  	} +	boot_cmdline_linux(images);  	boot_prep_linux(images);  	boot_jump_linux(images);  	/* does not return */  	return 1;  } - -static void linux_params_init(ulong start, char *line) -{ -	char *next, *quote, *argp; - -	linux_argc = 1; -	linux_argv = (char **) start; -	linux_argv[0] = 0; -	argp = (char *) (linux_argv + LINUX_MAX_ARGS); - -	next = line; - -	while (line && *line && linux_argc < LINUX_MAX_ARGS) { -		quote = strchr(line, '"'); -		next = strchr(line, ' '); - -		while (next && quote && quote < next) { -			/* we found a left quote before the next blank -			 * now we have to find the matching right quote -			 */ -			next = strchr(quote + 1, '"'); -			if (next) { -				quote = strchr(next + 1, '"'); -				next = strchr(next + 1, ' '); -			} -		} - -		if (!next) -			next = line + strlen(line); - -		linux_argv[linux_argc] = argp; -		memcpy(argp, line, next - line); -		argp[next - line] = 0; - -		argp += next - line + 1; -		linux_argc++; - -		if (*next) -			next++; - -		line = next; -	} - -	linux_env = (char **) (((ulong) argp + 15) & ~15); -	linux_env[0] = 0; -	linux_env_p = (char *) (linux_env + LINUX_MAX_ENVS); -	linux_env_idx = 0; -} - -static void linux_env_set(char *env_name, char *env_val) -{ -	if (linux_env_idx < LINUX_MAX_ENVS - 1) { -		linux_env[linux_env_idx] = linux_env_p; - -		strcpy(linux_env_p, env_name); -		linux_env_p += strlen(env_name); - -		strcpy(linux_env_p, "="); -		linux_env_p += 1; - -		strcpy(linux_env_p, env_val); -		linux_env_p += strlen(env_val); - -		linux_env_p++; -		linux_env[++linux_env_idx] = 0; -	} -} diff --git a/arch/mips/lib/bootm_qemu_mips.c b/arch/mips/lib/bootm_qemu_mips.c deleted file mode 100644 index 910ab7363..000000000 --- a/arch/mips/lib/bootm_qemu_mips.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * (C) Copyright 2008 - * Jean-Christophe PLAGNIOL-VILLARD <jcplagniol@jcrosoft.com> - * - * SPDX-License-Identifier:	GPL-2.0+ - */ - -#include <common.h> -#include <command.h> -#include <image.h> -#include <asm/byteorder.h> -#include <asm/addrspace.h> - -DECLARE_GLOBAL_DATA_PTR; - -int do_bootm_linux(int flag, int argc, char * const argv[], -			bootm_headers_t *images) -{ -	void (*theKernel) (int, char **, char **, int *); -	char *bootargs = getenv("bootargs"); -	char *start; -	uint len; - -	/* find kernel entry point */ -	theKernel = (void (*)(int, char **, char **, int *))images->ep; - -	bootstage_mark(BOOTSTAGE_ID_RUN_OS); - -	debug("## Transferring control to Linux (at address %08lx) ...\n", -		(ulong) theKernel); - -	gd->bd->bi_boot_params = gd->bd->bi_memstart + (16 << 20) - 256; -	debug("%-12s= 0x%08lX\n", "boot_params", (ulong)gd->bd->bi_boot_params); - -	/* set Magic */ -	*(int32_t *)(gd->bd->bi_boot_params - 4) = 0x12345678; -	/* set ram_size */ -	*(int32_t *)(gd->bd->bi_boot_params - 8) = gd->ram_size; - -	start = (char *)gd->bd->bi_boot_params; - -	len = strlen(bootargs); - -	strncpy(start, bootargs, len + 1); - -	start += len; - -	len = images->rd_end - images->rd_start; -	if (len > 0) { -		start += sprintf(start, " rd_start=0x%08X rd_size=0x%0X", -		(uint) UNCACHED_SDRAM(images->rd_start), -		(uint) len); -	} - -	/* we assume that the kernel is in place */ -	printf("\nStarting kernel ...\n\n"); - -	theKernel(0, NULL, NULL, 0); - -	/* does not return */ -	return 1; -} diff --git a/arch/nds32/include/asm/dma-mapping.h b/arch/nds32/include/asm/dma-mapping.h new file mode 100644 index 000000000..25e5a1b6e --- /dev/null +++ b/arch/nds32/include/asm/dma-mapping.h @@ -0,0 +1,33 @@ +/* + * Copyright (C) 2013 Andes Technology Corporation + * Ken Kuo, Andes Technology Corporation <ken_kuo@andestech.com> + * + * SPDX-License-Identifier:	GPL-2.0+ + */ +#ifndef __ASM_NDS_DMA_MAPPING_H +#define __ASM_NDS_DMA_MAPPING_H + +enum dma_data_direction { +	DMA_BIDIRECTIONAL	= 0, +	DMA_TO_DEVICE		= 1, +	DMA_FROM_DEVICE		= 2, +}; + +static void *dma_alloc_coherent(size_t len, unsigned long *handle) +{ +	*handle = (unsigned long)memalign(ARCH_DMA_MINALIGN, len); +	return (void *)*handle; +} + +static inline unsigned long dma_map_single(volatile void *vaddr, size_t len, +					   enum dma_data_direction dir) +{ +	return (unsigned long)vaddr; +} + +static inline void dma_unmap_single(volatile void *vaddr, size_t len, +				    unsigned long paddr) +{ +} + +#endif /* __ASM_NDS_DMA_MAPPING_H */ diff --git a/arch/powerpc/cpu/mpc8xx/video.c b/arch/powerpc/cpu/mpc8xx/video.c index 02cd0debc..02a046789 100644 --- a/arch/powerpc/cpu/mpc8xx/video.c +++ b/arch/powerpc/cpu/mpc8xx/video.c @@ -109,7 +109,6 @@ DECLARE_GLOBAL_DATA_PTR;  /************************************************************************/  #include <video_font.h>			/* Get font data, width and height */ -#include <video_font_data.h>  #ifdef CONFIG_VIDEO_LOGO  #include <video_logo.h>			/* Get logo data, width and height */ |