9
0
Fork 0

Merge branch 'for-next/misc'

Conflicts:
	scripts/Makefile
This commit is contained in:
Sascha Hauer 2013-12-06 08:23:24 +01:00
commit e9ea6eeaab
124 changed files with 413 additions and 190 deletions

View File

@ -15,7 +15,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -26,7 +26,7 @@
#include <fcntl.h>
#include <io.h>
#include <sizes.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include <mach/board.h>
#include <mach/iomux.h>

View File

@ -24,7 +24,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -26,7 +26,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -28,7 +28,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -15,7 +15,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -25,7 +25,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -25,7 +25,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -27,6 +27,7 @@
#include <init.h>
#include <gpio.h>
#include <fec.h>
#include <of.h>
#include <linux/micrel_phy.h>
#include <mfd/stmpe-i2c.h>

View File

@ -24,7 +24,7 @@
#include <fs.h>
#include <fcntl.h>
#include <asm/io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/mtd/nand.h>
#include <mach/board.h>

View File

@ -23,6 +23,7 @@
#include <led.h>
#include <fs.h>
#include <io.h>
#include <of.h>
#include <spi/spi.h>
#include <mfd/mc13xxx.h>

View File

@ -24,6 +24,7 @@
#include <generated/mach-types.h>
#include <partition.h>
#include <fs.h>
#include <of.h>
#include <fcntl.h>
#include <mach/bbu.h>
#include <nand.h>

View File

@ -22,6 +22,7 @@
#include <init.h>
#include <fs.h>
#include <io.h>
#include <of.h>
#include <mfd/mc13xxx.h>
#include <i2c/i2c.h>

View File

@ -25,6 +25,7 @@
#include <mach/imx6.h>
#include <mfd/imx6q-iomuxc-gpr.h>
#include <sizes.h>
#include <of.h>
#define GK802_GPIO_RECOVERY_BTN IMX_GPIO_NR(3, 16) /* recovery button */
#define GK802_GPIO_RTL8192_PDN IMX_GPIO_NR(2, 0) /* RTL8192CU powerdown */

View File

@ -26,7 +26,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/mtd/nand.h>
#include <mach/at91_pmc.h>

View File

@ -27,7 +27,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/mtd/nand.h>
#include <mach/at91_pmc.h>

View File

@ -28,7 +28,7 @@
#include <gpio.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/mtd/nand.h>
#include <mach/at91_pmc.h>

View File

@ -27,7 +27,7 @@
#include <fcntl.h>
#include <gpio.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <linux/mtd/nand.h>
#include <mach/at91_pmc.h>

View File

@ -15,7 +15,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -24,7 +24,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -24,7 +24,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -27,6 +27,7 @@
#include <init.h>
#include <gpio.h>
#include <fec.h>
#include <of.h>
#include <linux/micrel_phy.h>
#include <mfd/stmpe-i2c.h>

View File

@ -24,7 +24,7 @@
#include <fs.h>
#include <fcntl.h>
#include <io.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <nand.h>
#include <sizes.h>
#include <linux/mtd/nand.h>

View File

@ -20,6 +20,7 @@
#include <common.h>
#include <init.h>
#include <sizes.h>
#include <of.h>
#include <asm/barebox-arm.h>
#include <asm/barebox-arm-head.h>
#include <asm-generic/memory_layout.h>

View File

@ -34,6 +34,17 @@
};
};
&i2c1 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c1_1>;
eeprom: m24c32@50 {
compatible = "st,24c32", "at24";
reg = <0x50>;
};
};
&iomuxc {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_hog>;

View File

@ -1,18 +0,0 @@
/*
* linux/include/asm-arm/hardware.h
*
* Copyright (C) 1996 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Common hardware definitions
*/
#ifndef __ASM_HARDWARE_H
#define __ASM_HARDWARE_H
#include <mach/hardware.h>
#endif

View File

@ -342,7 +342,6 @@ config MACH_QIL_A9G20
Select this if you are using a Calao Systems QIL-A9G20 Board.
<http://www.calao-systems.com>
endchoice
endif

View File

@ -1,7 +1,7 @@
#include <common.h>
#include <gpio.h>
#include <init.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include "soc.h"

View File

@ -1,7 +1,7 @@
#include <common.h>
#include <gpio.h>
#include <init.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include "soc.h"

View File

@ -14,7 +14,7 @@
#include <sizes.h>
#include <gpio.h>
#include <asm/armlinux.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/board.h>
#include <mach/at91_pmc.h>
#include <mach/at91sam9260_matrix.h>

View File

@ -1,7 +1,7 @@
#include <common.h>
#include <gpio.h>
#include <init.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include "soc.h"

View File

@ -14,7 +14,7 @@
#include <sizes.h>
#include <gpio.h>
#include <asm/armlinux.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include <mach/at91sam9261_matrix.h>
#include <mach/at91sam9_sdramc.h>

View File

@ -1,7 +1,7 @@
#include <common.h>
#include <gpio.h>
#include <init.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include "soc.h"

View File

@ -14,7 +14,7 @@
#include <sizes.h>
#include <gpio.h>
#include <asm/armlinux.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include <mach/at91sam9263_matrix.h>
#include <mach/at91sam9_sdramc.h>

View File

@ -28,7 +28,7 @@
#include <common.h>
#include <init.h>
#include <clock.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pit.h>
#include <mach/io.h>
#include <io.h>

View File

@ -14,7 +14,7 @@
#include <sizes.h>
#include <gpio.h>
#include <asm/armlinux.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include <mach/at91sam9g45_matrix.h>
#include <mach/at91sam9_ddrsdr.h>

View File

@ -1,7 +1,7 @@
#include <common.h>
#include <gpio.h>
#include <init.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include <mach/io.h>
#include <mach/cpu.h>

View File

@ -14,7 +14,7 @@
#include <sizes.h>
#include <gpio.h>
#include <asm/armlinux.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/board.h>
#include <mach/at91_pmc.h>
#include <mach/at91sam9n12_matrix.h>

View File

@ -1,7 +1,7 @@
#include <common.h>
#include <gpio.h>
#include <init.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include <mach/io.h>
#include <mach/cpu.h>

View File

@ -13,7 +13,7 @@
#include <sizes.h>
#include <gpio.h>
#include <asm/armlinux.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/board.h>
#include <mach/at91_pmc.h>
#include <mach/at91sam9x5_matrix.h>

View File

@ -438,7 +438,7 @@ static void at91mux_dump_pio_config(unsigned bank, unsigned pin)
void __iomem *pio = at91_gpio->regbase;
u32 div;
printf("pio%c%d configuration\n\n", bank + 'A', pin);
printf("pio%c%u configuration\n\n", bank + 'A', pin);
at91mux_printf_mode(bank, pin);
printf("\n");
@ -499,7 +499,7 @@ static int do_at91mux(int argc, char *argv[])
}
if (pin >= 32) {
printf("pin %d >= supported %d pins\n", pin, 32);
printf("pin %u >= supported %d pins\n", pin, 32);
return 1;
}

View File

@ -1,7 +1,7 @@
#include <common.h>
#include <gpio.h>
#include <init.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/at91_pmc.h>
#include <mach/io.h>
#include <mach/cpu.h>

View File

@ -14,7 +14,7 @@
#include <sizes.h>
#include <gpio.h>
#include <asm/armlinux.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/board.h>
#include <mach/at91_pmc.h>
#include <mach/at91sam9x5_matrix.h>

View File

@ -185,8 +185,6 @@ if IMX_MULTI_BOARDS
config MACH_EFIKA_MX_SMARTBOOK
bool "Efika MX smartbook"
select ARCH_IMX51
select HAVE_DEFAULT_ENVIRONMENT_NEW
select HAVE_PBL_MULTI_IMAGES
help
Choose this to compile barebox for the Efika MX Smartbook
@ -216,8 +214,6 @@ config MACH_DFI_FS700_M60
config MACH_REALQ7
bool "DataModul i.MX6Q Real Qseven Board"
select ARCH_IMX6
select HAVE_DEFAULT_ENVIRONMENT_NEW
select HAVE_PBL_MULTI_IMAGES
config MACH_GK802
bool "Zealz GK802 Mini PC"
@ -266,7 +262,6 @@ config MACH_IMX21ADS
Say Y here if you are using the Freescale i.MX21ads board equipped
with a Freescale i.MX21 Processor
# ----------------------------------------------------------
comment "i.MX25 Boards"
@ -580,7 +575,7 @@ config ARCH_IMX_USBLOADER
config IMX_IIM
tristate "IIM fusebox device"
depends on !ARCH_IMX21 && !ARCH_IMX21
depends on !ARCH_IMX21
help
Device driver for the IC Identification Module (IIM) fusebox. Use the
regular md/mw commands to program and read the fusebox.

View File

@ -11,6 +11,7 @@
#include <driver.h>
#include <linux/clk.h>
#include <io.h>
#include <of.h>
#include <linux/clkdev.h>
#include <linux/err.h>
#include <mach/imx51-regs.h>

View File

@ -15,6 +15,7 @@
#include <driver.h>
#include <linux/clk.h>
#include <io.h>
#include <of.h>
#include <linux/clkdev.h>
#include <linux/err.h>
#include <mach/imx6-regs.h>

View File

@ -29,6 +29,7 @@
#include <init.h>
#include <clock.h>
#include <errno.h>
#include <of.h>
#include <linux/clk.h>
#include <linux/err.h>
#include <notifier.h>

View File

@ -18,6 +18,7 @@
#include <common.h>
#include <io.h>
#include <errno.h>
#include <sizes.h>
#include <init.h>
#include <asm/barebox-arm.h>

View File

@ -24,7 +24,7 @@
#include <param.h>
#include <fcntl.h>
#include <malloc.h>
#include <of.h>
#include <io.h>
#include <mach/iim.h>

View File

@ -360,7 +360,8 @@ static void imx_bbu_internal_v2_init_flash_header(struct bbu_handler *handler, s
flash_header->self = imx_handler->app_dest + flash_header_offset;
flash_header->boot_data.start = imx_handler->app_dest;
flash_header->boot_data.size = ALIGN(imx_pre_image_size + data->len, 4096);;
flash_header->boot_data.size = ALIGN(imx_pre_image_size +
data->len, 4096);
if (imx_handler->dcdsize) {
flash_header->dcd.header.tag = DCD_HEADER_TAG;

View File

@ -12,6 +12,7 @@
*/
#include <common.h>
#include <of.h>
#include <init.h>
#include <mach/revision.h>
#include <mach/generic.h>

View File

@ -2,6 +2,7 @@
#define __MACH_BBU_H
#include <bbu.h>
#include <errno.h>
struct imx_dcd_entry;
struct imx_dcd_v2_entry;

View File

@ -24,6 +24,7 @@
#include <init.h>
#include <net.h>
#include <io.h>
#include <of.h>
/*
* a single MAC address reference has the form

View File

@ -179,7 +179,7 @@ static int calc_bb_offset(struct mtd_info *mtd, struct mx28_fcb *fcb)
bb_mark_chunk = bb_mark_offset / chunk_total_size;
bb_mark_chunk_offs = bb_mark_offset - (bb_mark_chunk * chunk_total_size);
if (bb_mark_chunk_offs > chunk_data_size) {
printf("Unsupported ECC layout; BB mark resides in ECC data: %u\n",
printf("Unsupported ECC layout; BB mark resides in ECC data: %i\n",
bb_mark_chunk_offs);
return -EINVAL;
}
@ -267,12 +267,12 @@ static int find_fcb(struct mtd_info *mtd, void *ref, int page)
chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page);
ret = chip->ecc.read_page_raw(mtd, chip, buf, 1, page);
if (ret) {
printf("Failed to read FCB from page %u: %d\n", page, ret);
printf("Failed to read FCB from page %i: %d\n", page, ret);
return ret;
}
chip->select_chip(mtd, -1);
if (memcmp(buf, ref, mtd->writesize) == 0) {
printf("%s: Found FCB in page %u (%08x)\n", __func__,
printf("%s: Found FCB in page %i (%08x)\n", __func__,
page, page * mtd->writesize);
ret = 1;
}
@ -376,7 +376,7 @@ int update_bcb(int argc, char *argv[])
ret = write_fcb(mtd, buf, block);
if (ret) {
printf("Failed to write FCB to block %u\n", block);
printf("Failed to write FCB to block %i\n", block);
return ret;
}

View File

@ -15,6 +15,7 @@
#define __MACH_MMC_H
struct mxs_mci_platform_data {
const char *devname;
unsigned caps; /**< supported operating modes (MMC_MODE_*) */
unsigned voltages; /**< supported voltage range (MMC_VDD_*) */
unsigned f_min; /**< min operating frequency in Hz (0 -> no limit) */

View File

@ -99,7 +99,7 @@ void imx_gpio_mode(uint32_t m)
/* some pins are disabled when configured for GPIO */
if ((gpio_pin > MAX_GPIO_NO) && (GET_FUNC(m) == IS_GPIO)) {
printf("Cannot configure pad %d to GPIO\n", gpio_pin);
printf("Cannot configure pad %u to GPIO\n", gpio_pin);
return;
}

View File

@ -17,7 +17,7 @@
#include <common.h>
#include <init.h>
#include <linux/clkdev.h>
#include <asm/hardware.h>
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <asm/armlinux.h>
#include <generated/mach-types.h>

View File

@ -95,8 +95,8 @@ config BAREBOX_UPDATE_AM33XX_SPI_NOR_MLO
bool
depends on BAREBOX_UPDATE
help
Say Y for barebox update SPI NOR MLO handler.
AM35xx, AM33xx chips use big endian MLO for SPI NOR flash.
Say Y for barebox update SPI NOR MLO handler.
AM35xx, AM33xx chips use big endian MLO for SPI NOR flash.
config ARCH_TEXT_BASE
hex

View File

@ -48,10 +48,10 @@ config MPC8544
default y
config DDR_SPD
bool
default y
bool
default y
config FSL_DDR2
bool
default y
bool
default y
endif

View File

@ -21,66 +21,8 @@
#include <command.h>
#include <fs.h>
#include <getopt.h>
#include <fcntl.h>
#include <errno.h>
#include <xfuncs.h>
#include <malloc.h>
#include <linux/ctype.h>
static int file_crc(char* filename, ulong start, ulong size, ulong *crc,
ulong *total)
{
int fd, now;
int ret = 0;
char *buf;
*total = 0;
*crc = 0;
fd = open(filename, O_RDONLY);
if (fd < 0) {
printf("open %s: %s\n", filename, errno_str());
return fd;
}
if (start > 0) {
off_t lseek_ret;
errno = 0;
lseek_ret = lseek(fd, start, SEEK_SET);
if (lseek_ret == (off_t)-1 && errno) {
perror("lseek");
ret = -1;
goto out;
}
}
buf = xmalloc(4096);
while (size) {
now = min((ulong)4096, size);
now = read(fd, buf, now);
if (now < 0) {
ret = now;
perror("read");
goto out_free;
}
if (!now)
break;
*crc = crc32(*crc, buf, now);
size -= now;
*total += now;
}
printf ("CRC32 for %s 0x%08lx ... 0x%08lx ==> 0x%08lx",
filename, start, start + *total - 1, *crc);
out_free:
free(buf);
out:
close(fd);
return ret;
}
#include <environment.h>
static int crc_from_file(const char* file, ulong *crc)
{
@ -143,6 +85,9 @@ static int do_crc(int argc, char *argv[])
if (file_crc(filename, start, size, &crc, &total) < 0)
return 1;
printf("CRC32 for %s 0x%08lx ... 0x%08lx ==> 0x%08lx",
filename, (ulong)start, (ulong)start + total - 1, crc);
#ifdef CONFIG_CMD_CRC_CMP
if (vfilename) {
size = total;

View File

@ -21,6 +21,7 @@
#include <complete.h>
#include <driver.h>
#include <getopt.h>
#include <errno.h>
static int do_detect(int argc, char *argv[])
{

View File

@ -12,7 +12,7 @@
#include <magicvar.h>
#include <getopt.h>
#include <linux/stat.h>
#include <fs.h>
#include <errno.h>
static int do_filetype(int argc, char *argv[])
{

View File

@ -24,6 +24,7 @@
#include <getopt.h>
#include <command.h>
#include <envfs.h>
#include <errno.h>
#include <fs.h>
static int do_loadenv(int argc, char *argv[])

View File

@ -163,8 +163,8 @@ static void print_stats(int nr_passes, int length)
for (i = 0; i < MAX_ECC_BITS; i++)
printf("ECC %d bit error(s) : %d\n", i + 1, ecc_stats[i]);
printf("ECC >%d bit error(s) : %d\n", MAX_ECC_BITS, ecc_stats_over);
printf("ECC corrections failed : %d\n", ecc_failed_cnt);
printf("ECC >%d bit error(s) : %u\n", MAX_ECC_BITS, ecc_stats_over);
printf("ECC corrections failed : %u\n", ecc_failed_cnt);
printf("-------------------------\n");
}

View File

@ -285,6 +285,7 @@ config SIMPLE_READLINE
config LONGHELP
bool
depends on !SHELL_NONE
prompt "Enable long help texts"
config CBSIZE
@ -292,11 +293,6 @@ config CBSIZE
prompt "Buffer size for input from the Console"
default 1024
config MAXARGS
int
prompt "max. Number of arguments accepted for monitor commands"
default 16
choice
prompt "Select your shell"
@ -328,6 +324,12 @@ choice
at the end of the barebox startup process.
endchoice
config MAXARGS
int
depends on SHELL_SIMPLE
prompt "max. Number of arguments accepted for monitor commands"
default 16
config GLOB
bool
prompt "hush globbing support"
@ -364,6 +366,7 @@ config HUSH_GETOPT
This enables a getopt function builtin to hush.
config CMDLINE_EDITING
depends on !SHELL_NONE
bool
prompt "Enable command line editing"
@ -617,6 +620,13 @@ config BAREBOXENV_TARGET
'bareboxenv' is a tool to access the barebox environment from a running Linux
system. Say yes here to build it for the target.
config BAREBOXCRC32_TARGET
bool
prompt "build bareboxcrc32 tool for target"
help
'bareboxcrc32' is a userspacetool to generate the crc32 checksums the same way
barebox does. Say yes here to build it for the target.
config POLLER
bool "generic polling infrastructure"

View File

@ -25,6 +25,7 @@
#include <console.h>
#include <driver.h>
#include <fs.h>
#include <of.h>
#include <init.h>
#include <clock.h>
#include <kfifo.h>

View File

@ -1,6 +1,7 @@
#include <common.h>
#include <malloc.h>
#include <globalvar.h>
#include <errno.h>
#include <init.h>
#include <environment.h>
#include <magicvar.h>

View File

@ -1,4 +1,5 @@
#include <common.h>
#include <errno.h>
#define DISP_LINE_LEN 16

View File

@ -25,6 +25,7 @@
#include <memory.h>
#include <types.h>
#include <sizes.h>
#include <errno.h>
#include <memtest.h>
static const resource_size_t bitpattern[] = {

View File

@ -22,6 +22,7 @@
#include <magicvar.h>
#include <globalvar.h>
#include <environment.h>
#include <of.h>
int errno;
EXPORT_SYMBOL(errno);

View File

@ -27,19 +27,23 @@
* @param table partition table
* @return sector count
*/
static int disk_guess_size(struct device_d *dev, struct partition_entry *table)
static uint64_t disk_guess_size(struct device_d *dev,
struct partition_entry *table)
{
uint64_t size = 0;
int i;
for (i = 0; i < 4; i++) {
if (table[i].partition_start != 0) {
size += get_unaligned_le32(&table[i].partition_start) - size;
size += get_unaligned_le32(&table[i].partition_size);
if (get_unaligned_le32(&table[i].partition_start) != 0) {
uint64_t part_end = get_unaligned_le32(&table[i].partition_start) +
get_unaligned_le32(&table[i].partition_size);
if (size < part_end)
size = part_end;
}
}
return (int)size;
return size;
}
static void *read_mbr(struct block_device *blk)
@ -105,19 +109,71 @@ static int dos_get_disk_signature(struct param_d *p, void *_priv)
if (!buf)
return -EIO;
priv->signature = le32_to_cpup((__le32 *)(buf + 0x1b8));
priv->signature = get_unaligned_le32(buf + 0x1b8);
free(buf);
return 0;
}
static void dos_extended_partition(struct block_device *blk, struct partition_desc *pd,
struct partition *partition)
{
uint8_t *buf = dma_alloc(SECTOR_SIZE);
uint32_t ebr_sector = partition->first_sec;
struct partition_entry *table = (struct partition_entry *)&buf[0x1be];
while (pd->used_entries < ARRAY_SIZE(pd->parts)) {
int rc, i;
int n = pd->used_entries;
dev_dbg(blk->dev, "expect EBR in sector %x\n", ebr_sector);
rc = block_read(blk, buf, ebr_sector, 1);
if (rc != 0) {
dev_err(blk->dev, "Cannot read EBR partition table\n");
goto out;
}
/* sanity checks */
if (buf[0x1fe] != 0x55 || buf[0x1ff] != 0xaa) {
dev_err(blk->dev, "sector %x doesn't contain an EBR signature\n", ebr_sector);
goto out;
}
for (i = 0x1de; i < 0x1fe; ++i)
if (buf[i]) {
dev_err(blk->dev, "EBR's third or fourth partition non-empty\n");
goto out;
}
/* /sanity checks */
/* the first entry defines the extended partition */
pd->parts[n].first_sec = ebr_sector +
get_unaligned_le32(&table[0].partition_start);
pd->parts[n].size = get_unaligned_le32(&table[0].partition_size);
pd->parts[n].dos_partition_type = table[0].type;
pd->used_entries++;
/* the second entry defines the start of the next ebr if != 0 */
if (get_unaligned_le32(&table[1].partition_start))
ebr_sector = partition->first_sec +
get_unaligned_le32(&table[1].partition_start);
else
break;
}
out:
dma_free(buf);
return;
}
/**
* Check if a DOS like partition describes this block device
* @param blk Block device to register to
* @param pd Where to store the partition information
*
* It seems at least on ARM this routine canot use temp. stack space for the
* It seems at least on ARM this routine cannot use temp. stack space for the
* sector. So, keep the malloc/free.
*/
static void dos_partition(void *buf, struct block_device *blk,
@ -125,6 +181,7 @@ static void dos_partition(void *buf, struct block_device *blk,
{
struct partition_entry *table;
struct partition pentry;
struct partition *extended_partition = NULL;
uint8_t *buffer = buf;
int i;
struct disk_signature_priv *dsp;
@ -146,11 +203,32 @@ static void dos_partition(void *buf, struct block_device *blk,
pd->parts[n].size = pentry.size;
pd->parts[n].dos_partition_type = pentry.dos_partition_type;
pd->used_entries++;
/*
* Partitions of type 0x05 and 0x0f (and some more)
* contain extended partitions. Only check for type 0x0f
* here as this is the easiest to parse and common
* enough.
*/
if (pentry.dos_partition_type == 0x0f) {
if (!extended_partition)
extended_partition = &pd->parts[n];
else
/*
* An DOS MBR must only contain a single
* extended partition. Just ignore all
* but the first.
*/
dev_warn(blk->dev, "Skipping additional extended partition\n");
}
} else {
dev_dbg(blk->dev, "Skipping empty partition %d\n", i);
}
}
if (extended_partition)
dos_extended_partition(blk, pd, extended_partition);
dsp = xzalloc(sizeof(*dsp));
dsp->blk = blk;

View File

@ -35,6 +35,7 @@
#include <malloc.h>
#include <debug_ll.h>
#include <fs.h>
#include <errno.h>
#include <linux/stat.h>
#include <envfs.h>
#include <asm/sections.h>

View File

@ -10,6 +10,12 @@
#ifdef __BAREBOX__ /* Shut down "ANSI does not permit..." warnings */
#include <common.h>
#include <xfuncs.h>
#include <fs.h>
#include <fcntl.h>
#include <malloc.h>
#include <linux/ctype.h>
#include <errno.h>
#endif
#ifdef CONFIG_DYNAMIC_CRC_TABLE
@ -178,3 +184,57 @@ uint32_t crc32_no_comp(uint32_t crc, const void *_buf, unsigned int len)
return crc;
}
int file_crc(char *filename, ulong start, ulong size, ulong *crc,
ulong *total)
{
int fd, now;
int ret = 0;
char *buf;
*total = 0;
*crc = 0;
fd = open(filename, O_RDONLY);
if (fd < 0) {
printf("open %s: %s\n", filename, strerror(errno));
return fd;
}
if (start > 0) {
off_t lseek_ret;
errno = 0;
lseek_ret = lseek(fd, start, SEEK_SET);
if (lseek_ret == (off_t)-1 && errno) {
perror("lseek");
ret = -1;
goto out;
}
}
buf = xmalloc(4096);
while (size) {
now = min((ulong)4096, size);
now = read(fd, buf, now);
if (now < 0) {
ret = now;
perror("read");
goto out_free;
}
if (!now)
break;
*crc = crc32(*crc, buf, now);
size -= now;
*total += now;
}
out_free:
free(buf);
out:
close(fd);
return ret;
}
#ifdef __BAREBOX__
EXPORT_SYMBOL(file_crc);
#endif

View File

@ -29,6 +29,7 @@
#include <init.h>
#include <errno.h>
#include <io.h>
#include <of.h>
#include <malloc.h>
#include <scsi.h>
#include <linux/ctype.h>
@ -375,7 +376,7 @@ static int ahci_init_port(struct ahci_port *ahci_port)
ret = wait_on_timeout(WAIT_LINKUP,
(ahci_port_read(ahci_port, PORT_SCR_STAT) & 0xf) == 0x3);
if (ret) {
ahci_port_info(ahci_port, "SATA link timeout\n");;
ahci_port_info(ahci_port, "SATA link timeout\n");
ret = -ETIMEDOUT;
goto err_init;
}

View File

@ -1,6 +1,7 @@
#include <common.h>
#include <ata_drive.h>
#include <io.h>
#include <errno.h>
#include <clock.h>
#include <disks.h>
#include <malloc.h>

View File

@ -30,6 +30,7 @@
#include <ata_drive.h>
#include <platform_ide.h>
#include <io.h>
#include <of.h>
#include <linux/err.h>
#include <linux/clk.h>

View File

@ -1,6 +1,7 @@
#include <common.h>
#include <ata_drive.h>
#include <io.h>
#include <of.h>
#include <clock.h>
#include <disks.h>
#include <driver.h>

View File

@ -7,6 +7,7 @@
#include <common.h>
#include <driver.h>
#include <errno.h>
#include <of.h>
LIST_HEAD(bus_list);
EXPORT_SYMBOL(bus_list);

View File

@ -30,6 +30,7 @@
#include <linux/ctype.h>
#include <errno.h>
#include <fs.h>
#include <of.h>
#include <linux/list.h>
#include <complete.h>
#include <pinctrl.h>

View File

@ -20,6 +20,7 @@
#include <driver.h>
#include <errno.h>
#include <init.h>
#include <of.h>
static int platform_probe(struct device_d *dev)
{

View File

@ -435,6 +435,8 @@ static int at24_probe(struct device_d *dev)
devfs_create(&at24->cdev);
of_parse_partitions(&at24->cdev, dev->device_node);
return 0;
err_clients:

View File

@ -23,6 +23,7 @@
#include <common.h>
#include <errno.h>
#include <io.h>
#include <of.h>
#include <gpio.h>
#include <init.h>

View File

@ -34,6 +34,7 @@
#include <common.h>
#include <driver.h>
#include <init.h>
#include <of.h>
#include <malloc.h>
#include <types.h>
#include <xfuncs.h>

View File

@ -22,6 +22,7 @@
#include <malloc.h>
#include <xfuncs.h>
#include <init.h>
#include <of.h>
#include <i2c/i2c.h>

View File

@ -24,6 +24,7 @@
#include <common.h>
#include <driver.h>
#include <init.h>
#include <of.h>
#include <malloc.h>
#include <mci.h>
#include <clock.h>

View File

@ -34,6 +34,7 @@
#include <asm/byteorder.h>
#include <block.h>
#include <disks.h>
#include <of.h>
#include <linux/err.h>
#define MAX_BUFFER_NUMBER 0xffffffff
@ -831,7 +832,7 @@ static void mci_extract_card_capacity_from_csd(struct mci *mci)
mci->capacity = (csize + 1) << (cmult + 2);
}
mci->capacity *= 1 << UNSTUFF_BITS(mci->csd, 80, 4);;
mci->capacity *= 1 << UNSTUFF_BITS(mci->csd, 80, 4);
dev_dbg(&mci->dev, "Capacity: %u MiB\n", (unsigned)(mci->capacity >> 20));
}

View File

@ -570,6 +570,7 @@ static int mxs_mci_probe(struct device_d *hw_dev)
/* feed forward the platform specific values */
host->voltages = pd->voltages;
host->host_caps = pd->caps;
host->devname = pd->devname;
mxs_mci->clk = clk_get(hw_dev, NULL);
if (IS_ERR(mxs_mci->clk))

View File

@ -21,6 +21,7 @@
#include <xfuncs.h>
#include <errno.h>
#include <malloc.h>
#include <of.h>
#include <i2c/i2c.h>
#include <spi/spi.h>

View File

@ -19,6 +19,7 @@
#include <driver.h>
#include <xfuncs.h>
#include <errno.h>
#include <of.h>
#include <i2c/i2c.h>
#include <mfd/stmpe-i2c.h>

View File

@ -25,6 +25,7 @@
#include <ioctl.h>
#include <nand.h>
#include <errno.h>
#include <of.h>
#include "mtd.h"

View File

@ -17,6 +17,7 @@
#include <common.h>
#include <init.h>
#include <driver.h>
#include <of.h>
#include <spi/spi.h>
#include <spi/flash.h>
#include <xfuncs.h>

View File

@ -17,6 +17,7 @@
#include <linux/err.h>
#include <errno.h>
#include <io.h>
#include <of.h>
#include <clock.h>
#include <spi/spi.h>

View File

@ -62,7 +62,7 @@ config DRIVER_NET_SMC91111
config DRIVER_NET_DAVINCI_EMAC
bool "TI Davinci/OMAP EMAC ethernet driver"
depends on ARCH_DAVINCI || ARCH_OMAP3
depends on ARCH_OMAP3
select PHYLIB
config DRIVER_NET_DM9K

View File

@ -376,7 +376,7 @@ static int tse_eth_send(struct eth_device *edev, void *packet, int length)
alt_sgdma_do_sync_transfer(tx_sgdma, tx_desc_cur);
return 0;;
return 0;
}
static void tse_eth_halt(struct eth_device *edev)

View File

@ -86,7 +86,7 @@ static int netx_eth_send (struct eth_device *edev,
#endif
val = PFIFO_REG( PFIFO_BASE(CON_FIFO_PORT_LO(xcno)) );
if((val & FIFO_PTR_ERROR_MASK) & 0x8)
printf("error sending frame: %d\n",val);
printf("error sending frame: %u\n", val);
return 0;
}

View File

@ -82,7 +82,7 @@ struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr)
return bus->phy_map[addr];
phydev = get_phy_device(bus, addr);
if (IS_ERR(phydev) || phydev == NULL)
if (IS_ERR(phydev))
return phydev;
bus->phy_map[addr] = phydev;

View File

@ -217,7 +217,7 @@ struct phy_device *get_phy_device(struct mii_bus *bus, int addr)
/* If the phy_id is mostly Fs, there is no device there */
if ((phy_id & 0x1fffffff) == 0x1fffffff)
return NULL;
return ERR_PTR(-ENODEV);
dev = phy_device_create(bus, addr, phy_id);
@ -254,7 +254,7 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr,
if (!edev->phydev) {
if (addr >= 0) {
dev = mdiobus_scan(bus, addr);
if (!dev) {
if (IS_ERR(dev)) {
ret = -EIO;
goto fail;
}
@ -273,7 +273,7 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr,
continue;
dev = mdiobus_scan(bus, i);
if (!dev || dev->attached_dev)
if (IS_ERR(dev) || dev->attached_dev)
continue;
dev->attached_dev = edev;
@ -304,7 +304,7 @@ int phy_device_connect(struct eth_device *edev, struct mii_bus *bus, int addr,
return 0;
fail:
if (dev)
if (!IS_ERR(dev))
dev->attached_dev = NULL;
puts("Unable to find a PHY (unknown ID?)\n");
return ret;

View File

@ -20,6 +20,7 @@
#include <common.h>
#include <init.h>
#include <io.h>
#include <of.h>
#include <pinctrl.h>
#include <malloc.h>
#include <mach/iomux-v3.h>

View File

@ -19,6 +19,8 @@
#include <common.h>
#include <malloc.h>
#include <pinctrl.h>
#include <errno.h>
#include <of.h>
static LIST_HEAD(pinctrl_list);

View File

@ -20,6 +20,7 @@
#include <malloc.h>
#include <notifier.h>
#include <io.h>
#include <of.h>
#include <linux/err.h>
#include <linux/clk.h>

Some files were not shown because too many files have changed in this diff Show More