U-Boot
Threads by month
- ----- 2025 -----
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2000 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
February 2016
- 172 participants
- 570 discussions

[U-Boot] [PATCH V2 0/6] ARM: keystone: K2G: Add support for PMMC remoteproc load
by Nishanth Menon 15 Mar '16
by Nishanth Menon 15 Mar '16
15 Mar '16
Hi,
Here is the series for supporting TI's PMMC - a Power Management
co-processor in TI's K2G SoC. TI's SoC architecture requires the
microcontroller for power management functionality which is excersized
by various operating systems running on ARM, DSP and other compute
engines in a centralized manner.
Changes in V2:
- Updated remoteproc driver to work with device tree
- config env variable updates
Series based on:
master 52dd704bf8ed Merge branch 'master' of http://git.denx.de/u-boot-sunxi
Test log: http://pastebin.ubuntu.com/15200102/
Nishanth Menon (6):
ARM: keystone2: psc: redo doc in kernel-doc format
ARM: keystone2: psc-defs: use adequate () for macros
ARM: keystone2: psc: introduce function to hold and release module in
reset.
remoteproc: Add support for TI power processor
ARM: dts: k2g: Add support for PMMC
configs: k2g_evm: Add TI power processor support
arch/arm/dts/k2g.dtsi | 7 +
arch/arm/mach-keystone/include/mach/psc_defs.h | 10 +-
arch/arm/mach-keystone/psc.c | 200 +++++++++++++++++++------
configs/k2g_evm_defconfig | 2 +
drivers/remoteproc/Kconfig | 10 ++
drivers/remoteproc/Makefile | 1 +
drivers/remoteproc/ti_power_proc.c | 180 ++++++++++++++++++++++
include/configs/k2g_evm.h | 7 +
include/configs/ti_armv7_keystone2.h | 14 ++
9 files changed, 384 insertions(+), 47 deletions(-)
create mode 100644 drivers/remoteproc/ti_power_proc.c
--
2.7.0
2
23

15 Mar '16
With commit fe772ebd285b ("ARM: keystone2: Use common definition for
clk_get_rate"), we have centralized the clock code into a common clock
logic and the redundant files, unfortunately remained... Clean that
up.
Signed-off-by: Nishanth Menon <nm(a)ti.com>
---
arch/arm/mach-keystone/clock-k2e.c | 95 --------------------------------
arch/arm/mach-keystone/clock-k2hk.c | 105 ------------------------------------
arch/arm/mach-keystone/clock-k2l.c | 99 ----------------------------------
3 files changed, 299 deletions(-)
delete mode 100644 arch/arm/mach-keystone/clock-k2e.c
delete mode 100644 arch/arm/mach-keystone/clock-k2hk.c
delete mode 100644 arch/arm/mach-keystone/clock-k2l.c
diff --git a/arch/arm/mach-keystone/clock-k2e.c b/arch/arm/mach-keystone/clock-k2e.c
deleted file mode 100644
index 7d163a4b1ab9..000000000000
--- a/arch/arm/mach-keystone/clock-k2e.c
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Keystone2: get clk rate for K2E
- *
- * (C) Copyright 2012-2014
- * Texas Instruments Incorporated, <www.ti.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/clock_defs.h>
-
-/**
- * pll_freq_get - get pll frequency
- * Fout = Fref * NF(mult) / NR(prediv) / OD
- * @pll: pll identifier
- */
-static unsigned long pll_freq_get(int pll)
-{
- unsigned long mult = 1, prediv = 1, output_div = 2;
- unsigned long ret;
- u32 tmp, reg;
-
- if (pll == CORE_PLL) {
- ret = external_clk[sys_clk];
- if (pllctl_reg_read(pll, ctl) & PLLCTL_PLLEN) {
- /* PLL mode */
- tmp = __raw_readl(KS2_MAINPLLCTL0);
- prediv = (tmp & PLL_DIV_MASK) + 1;
- mult = (((tmp & PLLM_MULT_HI_SMASK) >> 6) |
- (pllctl_reg_read(pll, mult) &
- PLLM_MULT_LO_MASK)) + 1;
- output_div = ((pllctl_reg_read(pll, secctl) >>
- PLL_CLKOD_SHIFT) & PLL_CLKOD_MASK) + 1;
-
- ret = ret / prediv / output_div * mult;
- }
- } else {
- switch (pll) {
- case PASS_PLL:
- ret = external_clk[pa_clk];
- reg = KS2_PASSPLLCTL0;
- break;
- case DDR3_PLL:
- ret = external_clk[ddr3a_clk];
- reg = KS2_DDR3APLLCTL0;
- break;
- default:
- return 0;
- }
-
- tmp = __raw_readl(reg);
-
- if (!(tmp & PLLCTL_BYPASS)) {
- /* Bypass disabled */
- prediv = (tmp & PLL_DIV_MASK) + 1;
- mult = ((tmp >> PLL_MULT_SHIFT) & PLL_MULT_MASK) + 1;
- output_div = ((tmp >> PLL_CLKOD_SHIFT) &
- PLL_CLKOD_MASK) + 1;
- ret = ((ret / prediv) * mult) / output_div;
- }
- }
-
- return ret;
-}
-
-unsigned long clk_get_rate(unsigned int clk)
-{
- switch (clk) {
- case core_pll_clk: return pll_freq_get(CORE_PLL);
- case pass_pll_clk: return pll_freq_get(PASS_PLL);
- case ddr3_pll_clk: return pll_freq_get(DDR3_PLL);
- case sys_clk0_1_clk:
- case sys_clk0_clk: return pll_freq_get(CORE_PLL) / pll0div_read(1);
- case sys_clk1_clk: return pll_freq_get(CORE_PLL) / pll0div_read(2);
- case sys_clk2_clk: return pll_freq_get(CORE_PLL) / pll0div_read(3);
- case sys_clk3_clk: return pll_freq_get(CORE_PLL) / pll0div_read(4);
- case sys_clk0_2_clk: return clk_get_rate(sys_clk0_clk) / 2;
- case sys_clk0_3_clk: return clk_get_rate(sys_clk0_clk) / 3;
- case sys_clk0_4_clk: return clk_get_rate(sys_clk0_clk) / 4;
- case sys_clk0_6_clk: return clk_get_rate(sys_clk0_clk) / 6;
- case sys_clk0_8_clk: return clk_get_rate(sys_clk0_clk) / 8;
- case sys_clk0_12_clk: return clk_get_rate(sys_clk0_clk) / 12;
- case sys_clk0_24_clk: return clk_get_rate(sys_clk0_clk) / 24;
- case sys_clk1_3_clk: return clk_get_rate(sys_clk1_clk) / 3;
- case sys_clk1_4_clk: return clk_get_rate(sys_clk1_clk) / 4;
- case sys_clk1_6_clk: return clk_get_rate(sys_clk1_clk) / 6;
- case sys_clk1_12_clk: return clk_get_rate(sys_clk1_clk) / 12;
- default:
- break;
- }
-
- return 0;
-}
diff --git a/arch/arm/mach-keystone/clock-k2hk.c b/arch/arm/mach-keystone/clock-k2hk.c
deleted file mode 100644
index 2e368910bf05..000000000000
--- a/arch/arm/mach-keystone/clock-k2hk.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Keystone2: get clk rate for K2HK
- *
- * (C) Copyright 2012-2014
- * Texas Instruments Incorporated, <www.ti.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/clock_defs.h>
-
-/**
- * pll_freq_get - get pll frequency
- * Fout = Fref * NF(mult) / NR(prediv) / OD
- * @pll: pll identifier
- */
-static unsigned long pll_freq_get(int pll)
-{
- unsigned long mult = 1, prediv = 1, output_div = 2;
- unsigned long ret;
- u32 tmp, reg;
-
- if (pll == CORE_PLL) {
- ret = external_clk[sys_clk];
- if (pllctl_reg_read(pll, ctl) & PLLCTL_PLLEN) {
- /* PLL mode */
- tmp = __raw_readl(KS2_MAINPLLCTL0);
- prediv = (tmp & PLL_DIV_MASK) + 1;
- mult = (((tmp & PLLM_MULT_HI_SMASK) >> 6) |
- (pllctl_reg_read(pll, mult) &
- PLLM_MULT_LO_MASK)) + 1;
- output_div = ((pllctl_reg_read(pll, secctl) >>
- PLL_CLKOD_SHIFT) & PLL_CLKOD_MASK) + 1;
-
- ret = ret / prediv / output_div * mult;
- }
- } else {
- switch (pll) {
- case PASS_PLL:
- ret = external_clk[pa_clk];
- reg = KS2_PASSPLLCTL0;
- break;
- case TETRIS_PLL:
- ret = external_clk[tetris_clk];
- reg = KS2_ARMPLLCTL0;
- break;
- case DDR3A_PLL:
- ret = external_clk[ddr3a_clk];
- reg = KS2_DDR3APLLCTL0;
- break;
- case DDR3B_PLL:
- ret = external_clk[ddr3b_clk];
- reg = KS2_DDR3BPLLCTL0;
- break;
- default:
- return 0;
- }
-
- tmp = __raw_readl(reg);
-
- if (!(tmp & PLLCTL_BYPASS)) {
- /* Bypass disabled */
- prediv = (tmp & PLL_DIV_MASK) + 1;
- mult = ((tmp >> PLL_MULT_SHIFT) & PLL_MULT_MASK) + 1;
- output_div = ((tmp >> PLL_CLKOD_SHIFT) &
- PLL_CLKOD_MASK) + 1;
- ret = ((ret / prediv) * mult) / output_div;
- }
- }
-
- return ret;
-}
-
-unsigned long clk_get_rate(unsigned int clk)
-{
- switch (clk) {
- case core_pll_clk: return pll_freq_get(CORE_PLL);
- case pass_pll_clk: return pll_freq_get(PASS_PLL);
- case tetris_pll_clk: return pll_freq_get(TETRIS_PLL);
- case ddr3a_pll_clk: return pll_freq_get(DDR3A_PLL);
- case ddr3b_pll_clk: return pll_freq_get(DDR3B_PLL);
- case sys_clk0_1_clk:
- case sys_clk0_clk: return pll_freq_get(CORE_PLL) / pll0div_read(1);
- case sys_clk1_clk: return pll_freq_get(CORE_PLL) / pll0div_read(2);
- case sys_clk2_clk: return pll_freq_get(CORE_PLL) / pll0div_read(3);
- case sys_clk3_clk: return pll_freq_get(CORE_PLL) / pll0div_read(4);
- case sys_clk0_2_clk: return clk_get_rate(sys_clk0_clk) / 2;
- case sys_clk0_3_clk: return clk_get_rate(sys_clk0_clk) / 3;
- case sys_clk0_4_clk: return clk_get_rate(sys_clk0_clk) / 4;
- case sys_clk0_6_clk: return clk_get_rate(sys_clk0_clk) / 6;
- case sys_clk0_8_clk: return clk_get_rate(sys_clk0_clk) / 8;
- case sys_clk0_12_clk: return clk_get_rate(sys_clk0_clk) / 12;
- case sys_clk0_24_clk: return clk_get_rate(sys_clk0_clk) / 24;
- case sys_clk1_3_clk: return clk_get_rate(sys_clk1_clk) / 3;
- case sys_clk1_4_clk: return clk_get_rate(sys_clk1_clk) / 4;
- case sys_clk1_6_clk: return clk_get_rate(sys_clk1_clk) / 6;
- case sys_clk1_12_clk: return clk_get_rate(sys_clk1_clk) / 12;
- default:
- break;
- }
-
- return 0;
-}
diff --git a/arch/arm/mach-keystone/clock-k2l.c b/arch/arm/mach-keystone/clock-k2l.c
deleted file mode 100644
index 00040591925a..000000000000
--- a/arch/arm/mach-keystone/clock-k2l.c
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Keystone2: get clk rate for K2L
- *
- * (C) Copyright 2012-2014
- * Texas Instruments Incorporated, <www.ti.com>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <asm/arch/clock.h>
-#include <asm/arch/clock_defs.h>
-
-/**
- * pll_freq_get - get pll frequency
- * Fout = Fref * NF(mult) / NR(prediv) / OD
- * @pll: pll identifier
- */
-static unsigned long pll_freq_get(int pll)
-{
- unsigned long mult = 1, prediv = 1, output_div = 2;
- unsigned long ret;
- u32 tmp, reg;
-
- if (pll == CORE_PLL) {
- ret = external_clk[sys_clk];
- if (pllctl_reg_read(pll, ctl) & PLLCTL_PLLEN) {
- /* PLL mode */
- tmp = __raw_readl(KS2_MAINPLLCTL0);
- prediv = (tmp & PLL_DIV_MASK) + 1;
- mult = (((tmp & PLLM_MULT_HI_SMASK) >> 6) |
- (pllctl_reg_read(pll, mult) &
- PLLM_MULT_LO_MASK)) + 1;
- output_div = ((pllctl_reg_read(pll, secctl) >>
- PLL_CLKOD_SHIFT) & PLL_CLKOD_MASK) + 1;
-
- ret = ret / prediv / output_div * mult;
- }
- } else {
- switch (pll) {
- case PASS_PLL:
- ret = external_clk[pa_clk];
- reg = KS2_PASSPLLCTL0;
- break;
- case TETRIS_PLL:
- ret = external_clk[tetris_clk];
- reg = KS2_ARMPLLCTL0;
- break;
- case DDR3_PLL:
- ret = external_clk[ddr3a_clk];
- reg = KS2_DDR3APLLCTL0;
- break;
- default:
- return 0;
- }
-
- tmp = __raw_readl(reg);
- if (!(tmp & PLLCTL_BYPASS)) {
- /* Bypass disabled */
- prediv = (tmp & PLL_DIV_MASK) + 1;
- mult = ((tmp >> PLL_MULT_SHIFT) & PLL_MULT_MASK) + 1;
- output_div = ((tmp >> PLL_CLKOD_SHIFT) &
- PLL_CLKOD_MASK) + 1;
- ret = ((ret / prediv) * mult) / output_div;
- }
- }
-
- return ret;
-}
-
-unsigned long clk_get_rate(unsigned int clk)
-{
- switch (clk) {
- case core_pll_clk: return pll_freq_get(CORE_PLL);
- case pass_pll_clk: return pll_freq_get(PASS_PLL);
- case tetris_pll_clk: return pll_freq_get(TETRIS_PLL);
- case ddr3_pll_clk: return pll_freq_get(DDR3_PLL);
- case sys_clk0_1_clk:
- case sys_clk0_clk: return pll_freq_get(CORE_PLL) / pll0div_read(1);
- case sys_clk1_clk: return pll_freq_get(CORE_PLL) / pll0div_read(2);
- case sys_clk2_clk: return pll_freq_get(CORE_PLL) / pll0div_read(3);
- case sys_clk3_clk: return pll_freq_get(CORE_PLL) / pll0div_read(4);
- case sys_clk0_2_clk: return clk_get_rate(sys_clk0_clk) / 2;
- case sys_clk0_3_clk: return clk_get_rate(sys_clk0_clk) / 3;
- case sys_clk0_4_clk: return clk_get_rate(sys_clk0_clk) / 4;
- case sys_clk0_6_clk: return clk_get_rate(sys_clk0_clk) / 6;
- case sys_clk0_8_clk: return clk_get_rate(sys_clk0_clk) / 8;
- case sys_clk0_12_clk: return clk_get_rate(sys_clk0_clk) / 12;
- case sys_clk0_24_clk: return clk_get_rate(sys_clk0_clk) / 24;
- case sys_clk1_3_clk: return clk_get_rate(sys_clk1_clk) / 3;
- case sys_clk1_4_clk: return clk_get_rate(sys_clk1_clk) / 4;
- case sys_clk1_6_clk: return clk_get_rate(sys_clk1_clk) / 6;
- case sys_clk1_12_clk: return clk_get_rate(sys_clk1_clk) / 12;
- default:
- break;
- }
-
- return 0;
-}
--
2.7.0
3
3

[U-Boot] [PATCH V5 0/7] ARM: omap-common: Add board detection support for TI EVMs
by Steve Kipisz 15 Mar '16
by Steve Kipisz 15 Mar '16
15 Mar '16
Several TI EVMs have onboard EEPROM that contain board description
information. The onboard EEPROM on Beaglebone, Beaglebone Black, AM335x
EVM, AM43x EVM, AM57xx EVM, Beagleboard-x15 all share the same format.
This series of patches introduces code which is generic among these
platforms. The boards can use the data for any operations they might
choose.
V5 of the series now updates the v4 series to ensure that latest u-boot
platform support including BBG is supported as well.
This also setsup easier introduction of DRA7-evm variant of eeproms as well.
Testing:
AM335x:
BeagleBone-Green: http://pastebin.ubuntu.com/15183845/
BeagleBone-Black: http://pastebin.ubuntu.com/15183885/
AM335x-SK: http://pastebin.ubuntu.com/15188966/
AM437x:
AM437x-GPEVM: http://pastebin.ubuntu.com/15188896/
AM437x-SK: http://pastebin.ubuntu.com/15188940/
Am57xx:
AM57xx-gpevm: http://pastebin.ubuntu.com/15188997/
baseline:
master 595af9db2422 Merge branch 'master' of git://www.denx.de/git/u-boot-imx
Lokesh Vutla (1):
ARM: omap-common: Add standard access for board description EEPROM
Nishanth Menon (2):
ti: AM335x: Use generic EEPROM detection logic
ti: AM437x: Use generic EEPROM detection logic
Steve Kipisz (4):
ARM: OMAP4/5: Centralize early clock initialization
ARM: OMAP4/5: Centralize gpi2c_init
ARM: OMAP4/5: Add generic board detection hook
board: ti: AM57xx: Add detection logic for AM57xx-evm
arch/arm/Kconfig | 2 +
arch/arm/cpu/armv7/omap-common/clocks-common.c | 21 +-
arch/arm/cpu/armv7/omap-common/hwinit-common.c | 14 +-
arch/arm/cpu/armv7/omap5/Kconfig | 1 +
arch/arm/include/asm/arch-omap4/sys_proto.h | 4 +-
arch/arm/include/asm/arch-omap5/sys_proto.h | 4 +-
arch/arm/include/asm/omap_common.h | 7 +-
board/ti/am335x/Kconfig | 2 +
board/ti/am335x/board.c | 115 ++++-------
board/ti/am335x/board.h | 49 ++---
board/ti/am335x/mux.c | 13 +-
board/ti/am43xx/Kconfig | 2 +
board/ti/am43xx/board.c | 87 +++------
board/ti/am43xx/board.h | 37 +---
board/ti/am43xx/mux.c | 1 +
board/ti/am57xx/Kconfig | 2 +
board/ti/am57xx/board.c | 70 ++++++-
board/ti/common/Kconfig | 5 +
board/ti/common/Makefile | 6 +
board/ti/common/board_detect.c | 254 +++++++++++++++++++++++++
board/ti/common/board_detect.h | 140 ++++++++++++++
include/configs/am57xx_evm.h | 4 +
include/configs/ti_omap5_common.h | 2 +
23 files changed, 623 insertions(+), 219 deletions(-)
create mode 100644 board/ti/common/Kconfig
create mode 100644 board/ti/common/Makefile
create mode 100644 board/ti/common/board_detect.c
create mode 100644 board/ti/common/board_detect.h
--
2.7.0
4
24

[U-Boot] [PATCH] common: Add support for environment file in EXT4.
by stuartlï¼ vrt.com.au 15 Mar '16
by stuartlï¼ vrt.com.au 15 Mar '16
15 Mar '16
From: Stuart Longland <stuartl(a)vrt.com.au>
This is an enhancement that permits storing the environment file on an
EXT4 partition such as the root filesystem. It is based on the existing
FAT environment file code.
---
common/Makefile | 2 +
common/cmd_nvedit.c | 3 +-
common/env_ext4.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 131 insertions(+), 1 deletion(-)
create mode 100644 common/env_ext4.c
diff --git a/common/Makefile b/common/Makefile
index e1ae149..7a45fa8 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -57,6 +57,7 @@ obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_embedded.o
obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
+obj-$(CONFIG_ENV_IS_IN_EXT4) += env_ext4.o
obj-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
obj-$(CONFIG_ENV_IS_IN_NVRAM) += env_nvram.o
obj-$(CONFIG_ENV_IS_IN_ONENAND) += env_onenand.o
@@ -236,6 +237,7 @@ obj-$(CONFIG_SPL_ENV_SUPPORT) += env_callback.o
obj-$(CONFIG_ENV_IS_NOWHERE) += env_nowhere.o
obj-$(CONFIG_ENV_IS_IN_MMC) += env_mmc.o
obj-$(CONFIG_ENV_IS_IN_FAT) += env_fat.o
+obj-$(CONFIG_ENV_IS_IN_EXT4) += env_ext4.o
obj-$(CONFIG_ENV_IS_IN_NAND) += env_nand.o
obj-$(CONFIG_ENV_IS_IN_SPI_FLASH) += env_sf.o
obj-$(CONFIG_ENV_IS_IN_FLASH) += env_flash.o
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 855808c..242a1a4 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -43,6 +43,7 @@ DECLARE_GLOBAL_DATA_PTR;
!defined(CONFIG_ENV_IS_IN_DATAFLASH) && \
!defined(CONFIG_ENV_IS_IN_MMC) && \
!defined(CONFIG_ENV_IS_IN_FAT) && \
+ !defined(CONFIG_ENV_IS_IN_EXT4) && \
!defined(CONFIG_ENV_IS_IN_NAND) && \
!defined(CONFIG_ENV_IS_IN_NVRAM) && \
!defined(CONFIG_ENV_IS_IN_ONENAND) && \
@@ -51,7 +52,7 @@ DECLARE_GLOBAL_DATA_PTR;
!defined(CONFIG_ENV_IS_IN_UBI) && \
!defined(CONFIG_ENV_IS_NOWHERE)
# error Define one of CONFIG_ENV_IS_IN_{EEPROM|FLASH|DATAFLASH|ONENAND|\
-SPI_FLASH|NVRAM|MMC|FAT|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
+SPI_FLASH|NVRAM|MMC|FAT|EXT4|REMOTE|UBI} or CONFIG_ENV_IS_NOWHERE
#endif
/*
diff --git a/common/env_ext4.c b/common/env_ext4.c
new file mode 100644
index 0000000..ce748ed
--- /dev/null
+++ b/common/env_ext4.c
@@ -0,0 +1,127 @@
+/*
+ * (c) Copyright 2016 by VRT Technology
+ *
+ * Author:
+ * Stuart Longland <stuartl(a)vrt.com.au>
+ *
+ * Based on FAT environment driver
+ * (c) Copyright 2011 by Tigris Elektronik GmbH
+ *
+ * Author:
+ * Maximilian Schwerin <mvs(a)tigris.de>
+ *
+ * and EXT4 filesystem implementation
+ * (C) Copyright 2011 - 2012 Samsung Electronics
+ * EXT4 filesystem implementation in Uboot by
+ * Uma Shankar <uma.shankar(a)samsung.com>
+ * Manjunatha C Achar <a.manjunatha(a)samsung.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#include <common.h>
+
+#include <command.h>
+#include <environment.h>
+#include <linux/stddef.h>
+#include <malloc.h>
+#include <search.h>
+#include <errno.h>
+#include <ext4fs.h>
+#include <mmc.h>
+
+char *env_name_spec = "EXT4";
+
+env_t *env_ptr;
+
+DECLARE_GLOBAL_DATA_PTR;
+
+int env_init(void)
+{
+ /* use default */
+ gd->env_addr = (ulong)&default_environment[0];
+ gd->env_valid = 1;
+
+ return 0;
+}
+
+#ifdef CONFIG_CMD_SAVEENV
+int saveenv(void)
+{
+ env_t env_new;
+ block_dev_desc_t *dev_desc = NULL;
+ disk_partition_t info;
+ int dev, part;
+ int err;
+
+ err = env_export(&env_new);
+ if (err)
+ return err;
+
+ part = get_device_and_partition(EXT4_ENV_INTERFACE,
+ EXT4_ENV_DEVICE_AND_PART,
+ &dev_desc, &info, 1);
+ if (part < 0)
+ return 1;
+
+ dev = dev_desc->dev;
+ ext4fs_set_blk_dev(dev_desc, &info);
+
+ if (!ext4fs_mount(info.size)) {
+ printf("\n** Unable to use %s %s for saveenv **\n",
+ EXT4_ENV_INTERFACE, EXT4_ENV_DEVICE_AND_PART);
+ return 1;
+ }
+
+ err = ext4fs_write(EXT4_ENV_FILE, (void *)&env_new, sizeof(env_t));
+ ext4fs_close();
+
+ if (err == -1) {
+ printf("\n** Unable to write \"%s\" from %s%d:%d **\n",
+ EXT4_ENV_FILE, EXT4_ENV_INTERFACE, dev, part);
+ return 1;
+ }
+
+ puts("done\n");
+ return 0;
+}
+#endif /* CONFIG_CMD_SAVEENV */
+
+void env_relocate_spec(void)
+{
+ ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
+ block_dev_desc_t *dev_desc = NULL;
+ disk_partition_t info;
+ int dev, part;
+ int err;
+
+ part = get_device_and_partition(EXT4_ENV_INTERFACE,
+ EXT4_ENV_DEVICE_AND_PART,
+ &dev_desc, &info, 1);
+ if (part < 0)
+ goto err_env_relocate;
+
+ dev = dev_desc->dev;
+ ext4fs_set_blk_dev(dev_desc, &info);
+
+ if (!ext4fs_mount(info.size)) {
+ printf("\n** Unable to use %s %s for loading the env **\n",
+ EXT4_ENV_INTERFACE, EXT4_ENV_DEVICE_AND_PART);
+ goto err_env_relocate;
+ }
+
+ err = ext4_read_file(EXT4_ENV_FILE, buf, 0, CONFIG_ENV_SIZE);
+ ext4fs_close();
+
+ if (err == -1) {
+ printf("\n** Unable to read \"%s\" from %s%d:%d **\n",
+ EXT4_ENV_FILE, EXT4_ENV_INTERFACE, dev, part);
+ goto err_env_relocate;
+ }
+
+ env_import(buf, 1);
+ return;
+
+err_env_relocate:
+ set_default_env(NULL);
+}
--
2.4.10
2
1

14 Mar '16
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long
and causes 80-column violations, rename it to struct blk_desc.
Signed-off-by: Simon Glass <sjg(a)chromium.org>
Reviewed-by: Bin Meng <bmeng.cn(a)gmail.com>
---
Changes in v2: None
api/api.c | 2 +-
api/api_storage.c | 14 ++---
board/cm5200/fwupdate.c | 2 +-
board/mpl/pip405/README | 4 +-
cmd/disk.c | 2 +-
cmd/fat.c | 4 +-
cmd/gpt.c | 8 +--
cmd/host.c | 4 +-
cmd/ide.c | 22 ++++----
cmd/mmc.c | 2 +-
cmd/part.c | 8 +--
cmd/read.c | 4 +-
cmd/reiser.c | 4 +-
cmd/sata.c | 10 ++--
cmd/scsi.c | 12 ++---
cmd/unzip.c | 2 +-
cmd/usb.c | 2 +-
cmd/usb_mass_storage.c | 6 +--
cmd/zfs.c | 4 +-
common/env_fat.c | 4 +-
common/fb_mmc.c | 12 ++---
common/spl/spl_ext.c | 6 +--
common/spl/spl_fat.c | 8 +--
common/spl/spl_sata.c | 2 +-
common/spl/spl_usb.c | 2 +-
common/usb_storage.c | 22 ++++----
disk/part.c | 28 +++++-----
disk/part_amiga.c | 14 ++---
disk/part_dos.c | 19 +++----
disk/part_efi.c | 38 ++++++-------
disk/part_iso.c | 10 ++--
disk/part_mac.c | 19 ++++---
drivers/block/dwc_ahsata.c | 4 +-
drivers/block/sandbox.c | 12 ++---
drivers/block/systemace.c | 8 +--
drivers/dfu/dfu_mmc.c | 2 +-
drivers/mmc/mmc.c | 4 +-
drivers/mmc/mmc_private.h | 8 +--
drivers/mmc/mmc_write.c | 4 +-
fs/ext4/dev.c | 53 +++++++++---------
fs/ext4/ext4fs.c | 2 +-
fs/fat/fat.c | 6 +--
fs/fs.c | 6 +--
fs/reiserfs/dev.c | 33 +++++-------
fs/sandbox/sandboxfs.c | 4 +-
fs/ubifs/ubifs.c | 2 +-
fs/zfs/dev.c | 35 ++++++------
fs/zfs/zfs.c | 2 +-
include/common.h | 2 +-
include/ext4fs.h | 6 +--
include/fat.h | 4 +-
include/ide.h | 6 +--
include/mmc.h | 2 +-
include/part.h | 130 ++++++++++++++++++++++++---------------------
include/reiserfs.h | 2 +-
include/sandboxblockdev.h | 2 +-
include/sandboxfs.h | 2 +-
include/sata.h | 2 +-
include/spl.h | 10 ++--
include/systemace.h | 2 +-
include/ubifs_uboot.h | 2 +-
include/usb.h | 2 +-
include/usb_mass_storage.h | 2 +-
include/zfs_common.h | 4 +-
lib/gunzip.c | 2 +-
test/dm/usb.c | 2 +-
66 files changed, 338 insertions(+), 331 deletions(-)
diff --git a/api/api.c b/api/api.c
index c5f6edb..830d6fb 100644
--- a/api/api.c
+++ b/api/api.c
@@ -189,7 +189,7 @@ static int API_get_timer(va_list ap)
*
* - net: ð_device struct address from list pointed to by eth_devices
*
- * - storage: block_dev_desc_t struct address from &ide_dev_desc[n],
+ * - storage: struct blk_desc struct address from &ide_dev_desc[n],
* &scsi_dev_desc[n] and similar tables
*
****************************************************************************/
diff --git a/api/api_storage.c b/api/api_storage.c
index bc2b4d6..225a6cf 100644
--- a/api/api_storage.c
+++ b/api/api_storage.c
@@ -103,7 +103,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
int i;
- block_dev_desc_t *dd;
+ struct blk_desc *dd;
if (first) {
di->cookie = (void *)get_dev(specs[type].name, 0);
@@ -148,7 +148,7 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
di->type = specs[type].type;
if (di->cookie != NULL) {
- dd = (block_dev_desc_t *)di->cookie;
+ dd = (struct blk_desc *)di->cookie;
if (dd->type == DEV_TYPE_UNKNOWN) {
debugf("device instance exists, but is not active..");
found = 0;
@@ -166,9 +166,9 @@ static int dev_stor_get(int type, int first, int *more, struct device_info *di)
/*
- * returns: ENUM_IDE, ENUM_USB etc. based on block_dev_desc_t
+ * returns: ENUM_IDE, ENUM_USB etc. based on struct blk_desc
*/
-static int dev_stor_type(block_dev_desc_t *dd)
+static int dev_stor_type(struct blk_desc *dd)
{
int i, j;
@@ -308,7 +308,7 @@ int dev_enum_storage(struct device_info *di)
return 0;
}
-static int dev_stor_is_valid(int type, block_dev_desc_t *dd)
+static int dev_stor_is_valid(int type, struct blk_desc *dd)
{
int i;
@@ -328,7 +328,7 @@ int dev_open_stor(void *cookie)
if (type == ENUM_MAX)
return API_ENODEV;
- if (dev_stor_is_valid(type, (block_dev_desc_t *)cookie))
+ if (dev_stor_is_valid(type, (struct blk_desc *)cookie))
return 0;
return API_ENODEV;
@@ -348,7 +348,7 @@ int dev_close_stor(void *cookie)
lbasize_t dev_read_stor(void *cookie, void *buf, lbasize_t len, lbastart_t start)
{
int type;
- block_dev_desc_t *dd = (block_dev_desc_t *)cookie;
+ struct blk_desc *dd = (struct blk_desc *)cookie;
if ((type = dev_stor_type(dd)) == ENUM_MAX)
return 0;
diff --git a/board/cm5200/fwupdate.c b/board/cm5200/fwupdate.c
index 2b92362..d5064c1 100644
--- a/board/cm5200/fwupdate.c
+++ b/board/cm5200/fwupdate.c
@@ -81,7 +81,7 @@ static int load_rescue_image(ulong addr)
char dev[7];
char addr_str[16];
char * const argv[6] = { "fatload", "usb", dev, addr_str, nxri, NULL };
- block_dev_desc_t *stor_dev = NULL;
+ struct blk_desc *stor_dev = NULL;
cmd_tbl_t *bcmd;
/* Get name of firmware directory */
diff --git a/board/mpl/pip405/README b/board/mpl/pip405/README
index 1b73dbe..e900c56 100644
--- a/board/mpl/pip405/README
+++ b/board/mpl/pip405/README
@@ -217,8 +217,8 @@ Added files:
Block device changes:
---------------------
To allow the use of dos_part.c, mac_part.c and iso_part.c, the parameter
-block_dev_desc will be used when accessing the functions in these files. The block
-device descriptor (block_dev_desc) contains a pointer to the read routine of the
+blk_desc will be used when accessing the functions in these files. The block
+device descriptor (blk_desc) contains a pointer to the read routine of the
device, which will be used to read blocks from the device.
Renamed function ide_print to dev_print and moved it to the file disk/part.c to use
it for IDE ATAPI and SCSI devices.
diff --git a/cmd/disk.c b/cmd/disk.c
index 3025225..c53c2a2 100644
--- a/cmd/disk.c
+++ b/cmd/disk.c
@@ -20,7 +20,7 @@ int common_diskboot(cmd_tbl_t *cmdtp, const char *intf, int argc,
#if defined(CONFIG_IMAGE_FORMAT_LEGACY)
image_header_t *hdr;
#endif
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
#if defined(CONFIG_FIT)
const void *fit_hdr = NULL;
diff --git a/cmd/fat.c b/cmd/fat.c
index aae993d..82b9b38 100644
--- a/cmd/fat.c
+++ b/cmd/fat.c
@@ -69,7 +69,7 @@ static int do_fat_fsinfo(cmd_tbl_t *cmdtp, int flag, int argc,
char * const argv[])
{
int dev, part;
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
disk_partition_t info;
if (argc < 2) {
@@ -105,7 +105,7 @@ static int do_fat_fswrite(cmd_tbl_t *cmdtp, int flag,
int ret;
unsigned long addr;
unsigned long count;
- block_dev_desc_t *dev_desc = NULL;
+ struct blk_desc *dev_desc = NULL;
disk_partition_t info;
int dev = 0;
int part = 1;
diff --git a/cmd/gpt.c b/cmd/gpt.c
index d94d553..881367c 100644
--- a/cmd/gpt.c
+++ b/cmd/gpt.c
@@ -168,7 +168,7 @@ static bool found_key(const char *str, const char *key)
* @return - zero on success, otherwise error
*
*/
-static int set_gpt_info(block_dev_desc_t *dev_desc,
+static int set_gpt_info(struct blk_desc *dev_desc,
const char *str_part,
char **str_disk_guid,
disk_partition_t **partitions,
@@ -328,7 +328,7 @@ err:
return errno;
}
-static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part)
+static int gpt_default(struct blk_desc *blk_dev_desc, const char *str_part)
{
int ret;
char *str_disk_guid;
@@ -356,7 +356,7 @@ static int gpt_default(block_dev_desc_t *blk_dev_desc, const char *str_part)
return ret;
}
-static int gpt_verify(block_dev_desc_t *blk_dev_desc, const char *str_part)
+static int gpt_verify(struct blk_desc *blk_dev_desc, const char *str_part)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1,
blk_dev_desc->blksz);
@@ -408,7 +408,7 @@ static int do_gpt(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int ret = CMD_RET_SUCCESS;
int dev = 0;
char *ep;
- block_dev_desc_t *blk_dev_desc = NULL;
+ struct blk_desc *blk_dev_desc = NULL;
if (argc < 4 || argc > 5)
return CMD_RET_USAGE;
diff --git a/cmd/host.c b/cmd/host.c
index ba1460e..ee219ce 100644
--- a/cmd/host.c
+++ b/cmd/host.c
@@ -67,7 +67,7 @@ static int do_host_info(cmd_tbl_t *cmdtp, int flag, int argc,
int dev;
printf("%3s %12s %s\n", "dev", "blocks", "path");
for (dev = min_dev; dev <= max_dev; dev++) {
- block_dev_desc_t *blk_dev;
+ struct blk_desc *blk_dev;
int ret;
printf("%3d ", dev);
@@ -92,7 +92,7 @@ static int do_host_dev(cmd_tbl_t *cmdtp, int flag, int argc,
{
int dev;
char *ep;
- block_dev_desc_t *blk_dev;
+ struct blk_desc *blk_dev;
int ret;
if (argc < 1 || argc > 3)
diff --git a/cmd/ide.c b/cmd/ide.c
index f19a7ce..06202c5 100644
--- a/cmd/ide.c
+++ b/cmd/ide.c
@@ -53,7 +53,7 @@ ulong ide_bus_offset[CONFIG_SYS_IDE_MAXBUS] = {
static int ide_bus_ok[CONFIG_SYS_IDE_MAXBUS];
-block_dev_desc_t ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
+struct blk_desc ide_dev_desc[CONFIG_SYS_IDE_MAXDEVICE];
/* ------------------------------------------------------------------------- */
#ifdef CONFIG_IDE_RESET
@@ -62,7 +62,7 @@ static void ide_reset (void);
#define ide_reset() /* dummy */
#endif
-static void ide_ident (block_dev_desc_t *dev_desc);
+static void ide_ident(struct blk_desc *dev_desc);
static uchar ide_wait (int dev, ulong t);
#define IDE_TIME_OUT 2000 /* 2 sec timeout */
@@ -78,8 +78,8 @@ static void ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len
#endif
#ifdef CONFIG_ATAPI
-static void atapi_inquiry(block_dev_desc_t *dev_desc);
-static ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+static void atapi_inquiry(struct blk_desc *dev_desc);
+static ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer);
#endif
@@ -187,7 +187,7 @@ int do_ide(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
if (strcmp(argv[1], "read") == 0) {
ulong addr = simple_strtoul(argv[2], NULL, 16);
ulong cnt = simple_strtoul(argv[4], NULL, 16);
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
ulong n;
#ifdef CONFIG_SYS_64BIT_LBA
@@ -446,7 +446,7 @@ void ide_init(void)
/* ------------------------------------------------------------------------- */
#ifdef CONFIG_PARTITIONS
-block_dev_desc_t *ide_get_dev(int dev)
+struct blk_desc *ide_get_dev(int dev)
{
return (dev < CONFIG_SYS_IDE_MAXDEVICE) ? &ide_dev_desc[dev] : NULL;
}
@@ -541,7 +541,7 @@ __weak void ide_input_data(int dev, ulong *sect_buf, int words)
/* -------------------------------------------------------------------------
*/
-static void ide_ident(block_dev_desc_t *dev_desc)
+static void ide_ident(struct blk_desc *dev_desc)
{
unsigned char c;
hd_driveid_t iop;
@@ -713,7 +713,7 @@ static void ide_ident(block_dev_desc_t *dev_desc)
/* ------------------------------------------------------------------------- */
-ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
void *buffer)
{
int device = block_dev->dev;
@@ -839,7 +839,7 @@ IDE_READ_E:
/* ------------------------------------------------------------------------- */
-ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
const void *buffer)
{
int device = block_dev->dev;
@@ -1301,7 +1301,7 @@ error:
}
-static void atapi_inquiry(block_dev_desc_t *dev_desc)
+static void atapi_inquiry(struct blk_desc *dev_desc)
{
unsigned char ccb[12]; /* Command descriptor block */
unsigned char iobuf[64]; /* temp buf */
@@ -1394,7 +1394,7 @@ static void atapi_inquiry(block_dev_desc_t *dev_desc)
#define ATAPI_READ_BLOCK_SIZE 2048 /* assuming CD part */
#define ATAPI_READ_MAX_BLOCK (ATAPI_READ_MAX_BYTES/ATAPI_READ_BLOCK_SIZE)
-ulong atapi_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+ulong atapi_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
void *buffer)
{
int device = block_dev->dev;
diff --git a/cmd/mmc.c b/cmd/mmc.c
index 1c7156f..ab59e7f 100644
--- a/cmd/mmc.c
+++ b/cmd/mmc.c
@@ -424,7 +424,7 @@ static int do_mmc_rescan(cmd_tbl_t *cmdtp, int flag,
static int do_mmc_part(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
- block_dev_desc_t *mmc_dev;
+ struct blk_desc *mmc_dev;
struct mmc *mmc;
mmc = init_mmc_device(curr_device, false);
diff --git a/cmd/part.c b/cmd/part.c
index 5599509..a572aab 100644
--- a/cmd/part.c
+++ b/cmd/part.c
@@ -29,7 +29,7 @@
static int do_part_uuid(int argc, char * const argv[])
{
int part;
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
disk_partition_t info;
if (argc < 2)
@@ -52,7 +52,7 @@ static int do_part_uuid(int argc, char * const argv[])
static int do_part_list(int argc, char * const argv[])
{
int ret;
- block_dev_desc_t *desc;
+ struct blk_desc *desc;
char *var = NULL;
bool bootable = false;
int i;
@@ -114,7 +114,7 @@ static int do_part_list(int argc, char * const argv[])
static int do_part_start(int argc, char * const argv[])
{
- block_dev_desc_t *desc;
+ struct blk_desc *desc;
disk_partition_t info;
char buf[512] = { 0 };
int part;
@@ -148,7 +148,7 @@ static int do_part_start(int argc, char * const argv[])
static int do_part_size(int argc, char * const argv[])
{
- block_dev_desc_t *desc;
+ struct blk_desc *desc;
disk_partition_t info;
char buf[512] = { 0 };
int part;
diff --git a/cmd/read.c b/cmd/read.c
index 8710288..6a1e1d9 100644
--- a/cmd/read.c
+++ b/cmd/read.c
@@ -15,7 +15,7 @@
int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *ep;
- block_dev_desc_t *dev_desc = NULL;
+ struct blk_desc *dev_desc = NULL;
int dev;
int part = 0;
disk_partition_t part_info;
@@ -57,7 +57,7 @@ int do_read(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
offset = part_info.start;
limit = part_info.size;
} else {
- /* Largest address not available in block_dev_desc_t. */
+ /* Largest address not available in struct blk_desc. */
limit = ~0;
}
diff --git a/cmd/reiser.c b/cmd/reiser.c
index 8871564..1cca5eb 100644
--- a/cmd/reiser.c
+++ b/cmd/reiser.c
@@ -34,7 +34,7 @@ int do_reiserls (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
char *filename = "/";
int dev, part;
- block_dev_desc_t *dev_desc=NULL;
+ struct blk_desc *dev_desc = NULL;
disk_partition_t info;
if (argc < 3)
@@ -82,7 +82,7 @@ int do_reiserload (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int dev, part;
ulong addr = 0, filelen;
disk_partition_t info;
- block_dev_desc_t *dev_desc = NULL;
+ struct blk_desc *dev_desc = NULL;
unsigned long count;
char *addr_str;
diff --git a/cmd/sata.c b/cmd/sata.c
index 76bacea..a1faf2d 100644
--- a/cmd/sata.c
+++ b/cmd/sata.c
@@ -16,15 +16,15 @@
#include <sata.h>
static int sata_curr_device = -1;
-block_dev_desc_t sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
+struct blk_desc sata_dev_desc[CONFIG_SYS_SATA_MAX_DEVICE];
-static unsigned long sata_bread(block_dev_desc_t *block_dev, lbaint_t start,
+static unsigned long sata_bread(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt, void *dst)
{
return sata_read(block_dev->dev, start, blkcnt, dst);
}
-static unsigned long sata_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
+static unsigned long sata_bwrite(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt, const void *buffer)
{
return sata_write(block_dev->dev, start, blkcnt, buffer);
@@ -36,7 +36,7 @@ int __sata_initialize(void)
int i;
for (i = 0; i < CONFIG_SYS_SATA_MAX_DEVICE; i++) {
- memset(&sata_dev_desc[i], 0, sizeof(struct block_dev_desc));
+ memset(&sata_dev_desc[i], 0, sizeof(struct blk_desc));
sata_dev_desc[i].if_type = IF_TYPE_SATA;
sata_dev_desc[i].dev = i;
sata_dev_desc[i].part_type = PART_TYPE_UNKNOWN;
@@ -75,7 +75,7 @@ __weak int __sata_stop(void)
int sata_stop(void) __attribute__((weak, alias("__sata_stop")));
#ifdef CONFIG_PARTITIONS
-block_dev_desc_t *sata_get_dev(int dev)
+struct blk_desc *sata_get_dev(int dev)
{
return (dev < CONFIG_SYS_SATA_MAX_DEVICE) ? &sata_dev_desc[dev] : NULL;
}
diff --git a/cmd/scsi.c b/cmd/scsi.c
index bc7d1b6..dff811b 100644
--- a/cmd/scsi.c
+++ b/cmd/scsi.c
@@ -48,7 +48,7 @@ static int scsi_max_devs; /* number of highest available scsi device */
static int scsi_curr_dev; /* current device */
-static block_dev_desc_t scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
+static struct blk_desc scsi_dev_desc[CONFIG_SYS_SCSI_MAX_DEVICE];
/********************************************************************************
* forward declerations of some Setup Routines
@@ -66,9 +66,9 @@ void scsi_ident_cpy (unsigned char *dest, unsigned char *src, unsigned int len);
static int scsi_read_capacity(ccb *pccb, lbaint_t *capacity,
unsigned long *blksz);
-static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer);
-static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr,
+static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer);
@@ -239,7 +239,7 @@ void scsi_init(void)
#endif
#ifdef CONFIG_PARTITIONS
-block_dev_desc_t * scsi_get_dev(int dev)
+struct blk_desc *scsi_get_dev(int dev)
{
return (dev < CONFIG_SYS_SCSI_MAX_DEVICE) ? &scsi_dev_desc[dev] : NULL;
}
@@ -376,7 +376,7 @@ int do_scsi (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#define SCSI_MAX_READ_BLK 0xFFFF
#define SCSI_LBA48_READ 0xFFFFFFF
-static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+static ulong scsi_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer)
{
int device = block_dev->dev;
@@ -443,7 +443,7 @@ static ulong scsi_read(block_dev_desc_t *block_dev, lbaint_t blknr,
/* Almost the maximum amount of the scsi_ext command.. */
#define SCSI_MAX_WRITE_BLK 0xFFFF
-static ulong scsi_write(block_dev_desc_t *block_dev, lbaint_t blknr,
+static ulong scsi_write(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer)
{
int device = block_dev->dev;
diff --git a/cmd/unzip.c b/cmd/unzip.c
index 0686be6..5be1566 100644
--- a/cmd/unzip.c
+++ b/cmd/unzip.c
@@ -43,7 +43,7 @@ U_BOOT_CMD(
static int do_gzwrite(cmd_tbl_t *cmdtp, int flag,
int argc, char * const argv[])
{
- block_dev_desc_t *bdev;
+ struct blk_desc *bdev;
int ret;
unsigned char *addr;
unsigned long length;
diff --git a/cmd/usb.c b/cmd/usb.c
index c7b642c..5f3b06a 100644
--- a/cmd/usb.c
+++ b/cmd/usb.c
@@ -625,7 +625,7 @@ static int do_usb(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int i;
extern char usb_started;
#ifdef CONFIG_USB_STORAGE
- block_dev_desc_t *stor_dev;
+ struct blk_desc *stor_dev;
#endif
if (argc < 2)
diff --git a/cmd/usb_mass_storage.c b/cmd/usb_mass_storage.c
index 0415591..03b7e21 100644
--- a/cmd/usb_mass_storage.c
+++ b/cmd/usb_mass_storage.c
@@ -19,7 +19,7 @@
static int ums_read_sector(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, void *buf)
{
- block_dev_desc_t *block_dev = &ums_dev->block_dev;
+ struct blk_desc *block_dev = &ums_dev->block_dev;
lbaint_t blkstart = start + ums_dev->start_sector;
return block_dev->block_read(block_dev, blkstart, blkcnt, buf);
@@ -28,7 +28,7 @@ static int ums_read_sector(struct ums *ums_dev,
static int ums_write_sector(struct ums *ums_dev,
ulong start, lbaint_t blkcnt, const void *buf)
{
- block_dev_desc_t *block_dev = &ums_dev->block_dev;
+ struct blk_desc *block_dev = &ums_dev->block_dev;
lbaint_t blkstart = start + ums_dev->start_sector;
return block_dev->block_write(block_dev, blkstart, blkcnt, buf);
@@ -53,7 +53,7 @@ static void ums_fini(void)
static int ums_init(const char *devtype, const char *devnums)
{
char *s, *t, *devnum, *name;
- block_dev_desc_t *block_dev;
+ struct blk_desc *block_dev;
int ret;
struct ums *ums_new;
diff --git a/cmd/zfs.c b/cmd/zfs.c
index 0aed29e..9076a8a 100644
--- a/cmd/zfs.c
+++ b/cmd/zfs.c
@@ -39,7 +39,7 @@ static int do_zfs_load(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]
int part;
ulong addr = 0;
disk_partition_t info;
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
char buf[12];
unsigned long count;
const char *addr_str;
@@ -135,7 +135,7 @@ static int do_zfs_ls(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
const char *filename = "/";
int part;
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
disk_partition_t info;
struct device_s vdev;
diff --git a/common/env_fat.c b/common/env_fat.c
index d79d864..e88279e 100644
--- a/common/env_fat.c
+++ b/common/env_fat.c
@@ -38,7 +38,7 @@ int env_init(void)
int saveenv(void)
{
env_t env_new;
- block_dev_desc_t *dev_desc = NULL;
+ struct blk_desc *dev_desc = NULL;
disk_partition_t info;
int dev, part;
int err;
@@ -77,7 +77,7 @@ int saveenv(void)
void env_relocate_spec(void)
{
ALLOC_CACHE_ALIGN_BUFFER(char, buf, CONFIG_ENV_SIZE);
- block_dev_desc_t *dev_desc = NULL;
+ struct blk_desc *dev_desc = NULL;
disk_partition_t info;
int dev, part;
int err;
diff --git a/common/fb_mmc.c b/common/fb_mmc.c
index 6e742da..fd43085 100644
--- a/common/fb_mmc.c
+++ b/common/fb_mmc.c
@@ -22,10 +22,10 @@
static char *response_str;
struct fb_mmc_sparse {
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
};
-static int get_partition_info_efi_by_name_or_alias(block_dev_desc_t *dev_desc,
+static int get_partition_info_efi_by_name_or_alias(struct blk_desc *dev_desc,
const char *name, disk_partition_t *info)
{
int ret;
@@ -55,7 +55,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage,
char *data)
{
struct fb_mmc_sparse *sparse = priv;
- block_dev_desc_t *dev_desc = sparse->dev_desc;
+ struct blk_desc *dev_desc = sparse->dev_desc;
int ret;
ret = dev_desc->block_write(dev_desc, offset, size, data);
@@ -65,7 +65,7 @@ static int fb_mmc_sparse_write(struct sparse_storage *storage,
return ret;
}
-static void write_raw_image(block_dev_desc_t *dev_desc, disk_partition_t *info,
+static void write_raw_image(struct blk_desc *dev_desc, disk_partition_t *info,
const char *part_name, void *buffer,
unsigned int download_bytes)
{
@@ -100,7 +100,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id,
void *download_buffer, unsigned int download_bytes,
char *response)
{
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
disk_partition_t info;
/* initialize the response buffer */
@@ -165,7 +165,7 @@ void fb_mmc_flash_write(const char *cmd, unsigned int session_id,
void fb_mmc_erase(const char *cmd, char *response)
{
int ret;
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
disk_partition_t info;
lbaint_t blks, blks_start, blks_size, grp_size;
struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index a42fbd0..d29d229 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -10,7 +10,7 @@
#include <image.h>
#ifdef CONFIG_SPL_EXT_SUPPORT
-int spl_load_image_ext(block_dev_desc_t *block_dev,
+int spl_load_image_ext(struct blk_desc *block_dev,
int partition,
const char *filename)
{
@@ -64,7 +64,7 @@ end:
}
#ifdef CONFIG_SPL_OS_BOOT
-int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
+int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
{
int err;
__maybe_unused loff_t filelen, actlen;
@@ -137,7 +137,7 @@ defaults:
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
}
#else
-int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition)
+int spl_load_image_ext_os(struct blk_desc *block_dev, int partition)
{
return -ENOSYS;
}
diff --git a/common/spl/spl_fat.c b/common/spl/spl_fat.c
index 0daadbe..d761b26 100644
--- a/common/spl/spl_fat.c
+++ b/common/spl/spl_fat.c
@@ -19,7 +19,7 @@
static int fat_registered;
#ifdef CONFIG_SPL_FAT_SUPPORT
-static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
+static int spl_register_fat_device(struct blk_desc *block_dev, int partition)
{
int err = 0;
@@ -39,7 +39,7 @@ static int spl_register_fat_device(block_dev_desc_t *block_dev, int partition)
return err;
}
-int spl_load_image_fat(block_dev_desc_t *block_dev,
+int spl_load_image_fat(struct blk_desc *block_dev,
int partition,
const char *filename)
{
@@ -72,7 +72,7 @@ end:
}
#ifdef CONFIG_SPL_OS_BOOT
-int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
+int spl_load_image_fat_os(struct blk_desc *block_dev, int partition)
{
int err;
__maybe_unused char *file;
@@ -121,7 +121,7 @@ defaults:
CONFIG_SPL_FS_LOAD_KERNEL_NAME);
}
#else
-int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition)
+int spl_load_image_fat_os(struct blk_desc *block_dev, int partition)
{
return -ENOSYS;
}
diff --git a/common/spl/spl_sata.c b/common/spl/spl_sata.c
index 3ba4c24..1719946 100644
--- a/common/spl/spl_sata.c
+++ b/common/spl/spl_sata.c
@@ -23,7 +23,7 @@ DECLARE_GLOBAL_DATA_PTR;
int spl_sata_load_image(void)
{
int err;
- block_dev_desc_t *stor_dev;
+ struct blk_desc *stor_dev;
err = init_sata(CONFIG_SPL_SATA_BOOT_DEVICE);
if (err) {
diff --git a/common/spl/spl_usb.c b/common/spl/spl_usb.c
index 588b85c..c42848e 100644
--- a/common/spl/spl_usb.c
+++ b/common/spl/spl_usb.c
@@ -25,7 +25,7 @@ static int usb_stor_curr_dev = -1; /* current device */
int spl_usb_load_image(void)
{
int err;
- block_dev_desc_t *stor_dev;
+ struct blk_desc *stor_dev;
usb_stop();
err = usb_init();
diff --git a/common/usb_storage.c b/common/usb_storage.c
index 8737cf7..ca5aeea 100644
--- a/common/usb_storage.c
+++ b/common/usb_storage.c
@@ -67,7 +67,7 @@ static __u32 CBWTag;
static int usb_max_devs; /* number of highest available usb device */
-static block_dev_desc_t usb_dev_desc[USB_MAX_STOR_DEV];
+static struct blk_desc usb_dev_desc[USB_MAX_STOR_DEV];
struct us_data;
typedef int (*trans_cmnd)(ccb *cb, struct us_data *data);
@@ -115,17 +115,17 @@ static struct us_data usb_stor[USB_MAX_STOR_DEV];
#define USB_STOR_TRANSPORT_ERROR -2
int usb_stor_get_info(struct usb_device *dev, struct us_data *us,
- block_dev_desc_t *dev_desc);
+ struct blk_desc *dev_desc);
int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
struct us_data *ss);
-static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer);
-static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr,
+static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer);
void uhci_show_temp_int_td(void);
#ifdef CONFIG_PARTITIONS
-block_dev_desc_t *usb_stor_get_dev(int index)
+struct blk_desc *usb_stor_get_dev(int index)
{
return (index < usb_max_devs) ? &usb_dev_desc[index] : NULL;
}
@@ -187,10 +187,10 @@ static int usb_stor_probe_device(struct usb_device *dev)
for (lun = 0;
lun <= max_lun && usb_max_devs < USB_MAX_STOR_DEV;
lun++) {
- struct block_dev_desc *blkdev;
+ struct blk_desc *blkdev;
blkdev = &usb_dev_desc[usb_max_devs];
- memset(blkdev, '\0', sizeof(block_dev_desc_t));
+ memset(blkdev, '\0', sizeof(struct blk_desc));
blkdev->if_type = IF_TYPE_USB;
blkdev->dev = usb_max_devs;
blkdev->part_type = PART_TYPE_UNKNOWN;
@@ -1011,7 +1011,7 @@ static int usb_write_10(ccb *srb, struct us_data *ss, unsigned long start,
* device with proper values (as reported by 'usb info').
*
* Vendor and product length limits are taken from the definition of
- * block_dev_desc_t in include/part.h.
+ * struct blk_desc in include/part.h.
*/
static void usb_bin_fixup(struct usb_device_descriptor descriptor,
unsigned char vendor[],
@@ -1026,7 +1026,7 @@ static void usb_bin_fixup(struct usb_device_descriptor descriptor,
}
#endif /* CONFIG_USB_BIN_FIXUP */
-static unsigned long usb_stor_read(block_dev_desc_t *block_dev, lbaint_t blknr,
+static unsigned long usb_stor_read(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, void *buffer)
{
int device = block_dev->dev;
@@ -1097,7 +1097,7 @@ retry_it:
return blkcnt;
}
-static unsigned long usb_stor_write(block_dev_desc_t *block_dev, lbaint_t blknr,
+static unsigned long usb_stor_write(struct blk_desc *block_dev, lbaint_t blknr,
lbaint_t blkcnt, const void *buffer)
{
int device = block_dev->dev;
@@ -1289,7 +1289,7 @@ int usb_storage_probe(struct usb_device *dev, unsigned int ifnum,
}
int usb_stor_get_info(struct usb_device *dev, struct us_data *ss,
- block_dev_desc_t *dev_desc)
+ struct blk_desc *dev_desc)
{
unsigned char perq, modi;
ALLOC_CACHE_ALIGN_BUFFER(u32, cap, 2);
diff --git a/disk/part.c b/disk/part.c
index 1935b28..7f98d89 100644
--- a/disk/part.c
+++ b/disk/part.c
@@ -22,7 +22,7 @@
struct block_drvr {
char *name;
- block_dev_desc_t* (*get_dev)(int dev);
+ struct blk_desc* (*get_dev)(int dev);
int (*select_hwpart)(int dev_num, int hwpart);
};
@@ -58,10 +58,10 @@ static const struct block_drvr block_drvr[] = {
DECLARE_GLOBAL_DATA_PTR;
#ifdef HAVE_BLOCK_DEVICE
-static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
+static struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
{
const struct block_drvr *drvr = block_drvr;
- block_dev_desc_t* (*reloc_get_dev)(int dev);
+ struct blk_desc* (*reloc_get_dev)(int dev);
int (*select_hwpart)(int dev_num, int hwpart);
char *name;
int ret;
@@ -84,7 +84,7 @@ static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
select_hwpart += gd->reloc_off;
#endif
if (strncmp(ifname, name, strlen(name)) == 0) {
- block_dev_desc_t *dev_desc = reloc_get_dev(dev);
+ struct blk_desc *dev_desc = reloc_get_dev(dev);
if (!dev_desc)
return NULL;
if (hwpart == 0 && !select_hwpart)
@@ -101,17 +101,17 @@ static block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
return NULL;
}
-block_dev_desc_t *get_dev(const char *ifname, int dev)
+struct blk_desc *get_dev(const char *ifname, int dev)
{
return get_dev_hwpart(ifname, dev, 0);
}
#else
-block_dev_desc_t *get_dev_hwpart(const char *ifname, int dev, int hwpart)
+struct blk_desc *get_dev_hwpart(const char *ifname, int dev, int hwpart)
{
return NULL;
}
-block_dev_desc_t *get_dev(const char *ifname, int dev)
+struct blk_desc *get_dev(const char *ifname, int dev)
{
return NULL;
}
@@ -144,7 +144,7 @@ static lba512_t lba512_muldiv(lba512_t block_count, lba512_t mul_by, lba512_t di
return bc_quot * mul_by + (bc_rem * mul_by) / div_by;
}
-void dev_print (block_dev_desc_t *dev_desc)
+void dev_print (struct blk_desc *dev_desc)
{
lba512_t lba512; /* number of blocks if 512bytes block size */
@@ -250,7 +250,7 @@ void dev_print (block_dev_desc_t *dev_desc)
#ifdef HAVE_BLOCK_DEVICE
-void init_part(block_dev_desc_t *dev_desc)
+void init_part(struct blk_desc *dev_desc)
{
#ifdef CONFIG_ISO_PARTITION
if (test_part_iso(dev_desc) == 0) {
@@ -297,7 +297,7 @@ void init_part(block_dev_desc_t *dev_desc)
defined(CONFIG_AMIGA_PARTITION) || \
defined(CONFIG_EFI_PARTITION)
-static void print_part_header(const char *type, block_dev_desc_t *dev_desc)
+static void print_part_header(const char *type, struct blk_desc *dev_desc)
{
puts ("\nPartition Map for ");
switch (dev_desc->if_type) {
@@ -335,7 +335,7 @@ static void print_part_header(const char *type, block_dev_desc_t *dev_desc)
#endif /* any CONFIG_..._PARTITION */
-void print_part(block_dev_desc_t * dev_desc)
+void print_part(struct blk_desc *dev_desc)
{
switch (dev_desc->part_type) {
@@ -383,7 +383,7 @@ void print_part(block_dev_desc_t * dev_desc)
#endif /* HAVE_BLOCK_DEVICE */
-int get_partition_info(block_dev_desc_t *dev_desc, int part,
+int get_partition_info(struct blk_desc *dev_desc, int part,
disk_partition_t *info)
{
#ifdef HAVE_BLOCK_DEVICE
@@ -450,7 +450,7 @@ int get_partition_info(block_dev_desc_t *dev_desc, int part,
}
int get_device(const char *ifname, const char *dev_hwpart_str,
- block_dev_desc_t **dev_desc)
+ struct blk_desc **dev_desc)
{
char *ep;
char *dup_str = NULL;
@@ -512,7 +512,7 @@ cleanup:
#define PART_AUTO -1
#define MAX_SEARCH_PARTITIONS 16
int get_device_and_partition(const char *ifname, const char *dev_part_str,
- block_dev_desc_t **dev_desc,
+ struct blk_desc **dev_desc,
disk_partition_t *info, int allow_whole_dev)
{
int ret = -1;
diff --git a/disk/part_amiga.c b/disk/part_amiga.c
index 57c1b9d..008941c 100644
--- a/disk/part_amiga.c
+++ b/disk/part_amiga.c
@@ -126,7 +126,7 @@ static void print_part_info(struct partition_block *p)
* the ID AMIGA_ID_RDISK ('RDSK') and needs to have a valid
* sum-to-zero checksum
*/
-struct rigid_disk_block *get_rdisk(block_dev_desc_t *dev_desc)
+struct rigid_disk_block *get_rdisk(struct blk_desc *dev_desc)
{
int i;
int limit;
@@ -166,7 +166,7 @@ struct rigid_disk_block *get_rdisk(block_dev_desc_t *dev_desc)
* Ridgid disk block
*/
-struct bootcode_block *get_bootcode(block_dev_desc_t *dev_desc)
+struct bootcode_block *get_bootcode(struct blk_desc *dev_desc)
{
int i;
int limit;
@@ -207,7 +207,7 @@ struct bootcode_block *get_bootcode(block_dev_desc_t *dev_desc)
* Test if the given partition has an Amiga partition table/Rigid
* Disk block
*/
-int test_part_amiga(block_dev_desc_t *dev_desc)
+int test_part_amiga(struct blk_desc *dev_desc)
{
struct rigid_disk_block *rdb;
struct bootcode_block *bootcode;
@@ -236,7 +236,8 @@ int test_part_amiga(block_dev_desc_t *dev_desc)
/*
* Find partition number partnum on the given drive.
*/
-static struct partition_block *find_partition(block_dev_desc_t *dev_desc, int partnum)
+static struct partition_block *find_partition(struct blk_desc *dev_desc,
+ int partnum)
{
struct rigid_disk_block *rdb;
struct partition_block *p;
@@ -290,7 +291,8 @@ static struct partition_block *find_partition(block_dev_desc_t *dev_desc, int pa
/*
* Get info about a partition
*/
-int get_partition_info_amiga (block_dev_desc_t *dev_desc, int part, disk_partition_t *info)
+int get_partition_info_amiga(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info)
{
struct partition_block *p = find_partition(dev_desc, part-1);
struct amiga_part_geometry *g;
@@ -317,7 +319,7 @@ int get_partition_info_amiga (block_dev_desc_t *dev_desc, int part, disk_partiti
return 0;
}
-void print_part_amiga (block_dev_desc_t *dev_desc)
+void print_part_amiga(struct blk_desc *dev_desc)
{
struct rigid_disk_block *rdb;
struct bootcode_block *boot;
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 08872d6..ea0315c 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -87,7 +87,7 @@ static int test_block_type(unsigned char *buffer)
}
-int test_part_dos (block_dev_desc_t *dev_desc)
+int test_part_dos(struct blk_desc *dev_desc)
{
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
@@ -102,7 +102,7 @@ int test_part_dos (block_dev_desc_t *dev_desc)
/* Print a partition that is relative to its Extended partition table
*/
-static void print_partition_extended(block_dev_desc_t *dev_desc,
+static void print_partition_extended(struct blk_desc *dev_desc,
lbaint_t ext_part_sector,
lbaint_t relative,
int part_num, unsigned int disksig)
@@ -167,11 +167,11 @@ static void print_partition_extended(block_dev_desc_t *dev_desc,
/* Print a partition that is relative to its Extended partition table
*/
-static int get_partition_info_extended (block_dev_desc_t *dev_desc,
- lbaint_t ext_part_sector,
- lbaint_t relative, int part_num,
- int which_part, disk_partition_t *info,
- unsigned int disksig)
+static int get_partition_info_extended(struct blk_desc *dev_desc,
+ lbaint_t ext_part_sector,
+ lbaint_t relative, int part_num,
+ int which_part, disk_partition_t *info,
+ unsigned int disksig)
{
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
dos_partition_t *pt;
@@ -283,13 +283,14 @@ static int get_partition_info_extended (block_dev_desc_t *dev_desc,
return -1;
}
-void print_part_dos (block_dev_desc_t *dev_desc)
+void print_part_dos(struct blk_desc *dev_desc)
{
printf("Part\tStart Sector\tNum Sectors\tUUID\t\tType\n");
print_partition_extended(dev_desc, 0, 0, 1, 0);
}
-int get_partition_info_dos (block_dev_desc_t *dev_desc, int part, disk_partition_t * info)
+int get_partition_info_dos(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info)
{
return get_partition_info_extended(dev_desc, 0, 0, 1, part, info, 0);
}
diff --git a/disk/part_efi.c b/disk/part_efi.c
index e1b58c5..db5e7ed 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -41,10 +41,10 @@ static inline u32 efi_crc32(const void *buf, u32 len)
static int pmbr_part_valid(struct partition *part);
static int is_pmbr_valid(legacy_mbr * mbr);
-static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba,
+static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
gpt_header *pgpt_head, gpt_entry **pgpt_pte);
-static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc,
- gpt_header * pgpt_head);
+static gpt_entry *alloc_read_gpt_entries(struct blk_desc *dev_desc,
+ gpt_header *pgpt_head);
static int is_pte_valid(gpt_entry * pte);
static char *print_efiname(gpt_entry *pte)
@@ -176,7 +176,7 @@ static void prepare_backup_gpt_header(gpt_header *gpt_h)
* Public Functions (include/part.h)
*/
-void print_part_efi(block_dev_desc_t * dev_desc)
+void print_part_efi(struct blk_desc *dev_desc)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz);
gpt_entry *gpt_pte = NULL;
@@ -237,8 +237,8 @@ void print_part_efi(block_dev_desc_t * dev_desc)
return;
}
-int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
- disk_partition_t * info)
+int get_partition_info_efi(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->blksz);
gpt_entry *gpt_pte = NULL;
@@ -300,7 +300,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
return 0;
}
-int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc,
+int get_partition_info_efi_by_name(struct blk_desc *dev_desc,
const char *name, disk_partition_t *info)
{
int ret;
@@ -319,7 +319,7 @@ int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc,
return -2;
}
-int test_part_efi(block_dev_desc_t * dev_desc)
+int test_part_efi(struct blk_desc *dev_desc)
{
ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, legacymbr, 1, dev_desc->blksz);
@@ -337,7 +337,7 @@ int test_part_efi(block_dev_desc_t * dev_desc)
*
* @return - zero on success, otherwise error
*/
-static int set_protective_mbr(block_dev_desc_t *dev_desc)
+static int set_protective_mbr(struct blk_desc *dev_desc)
{
/* Setup the Protective MBR */
ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, p_mbr, 1);
@@ -363,7 +363,7 @@ static int set_protective_mbr(block_dev_desc_t *dev_desc)
return 0;
}
-int write_gpt_table(block_dev_desc_t *dev_desc,
+int write_gpt_table(struct blk_desc *dev_desc,
gpt_header *gpt_h, gpt_entry *gpt_e)
{
const int pte_blk_cnt = BLOCK_CNT((gpt_h->num_partition_entries
@@ -517,7 +517,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
return 0;
}
-int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
+int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
char *str_guid, int parts_count)
{
gpt_h->signature = cpu_to_le64(GPT_HEADER_SIGNATURE);
@@ -539,7 +539,7 @@ int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
return 0;
}
-int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
+int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
disk_partition_t *partitions, int parts_count)
{
int ret;
@@ -595,7 +595,7 @@ static void gpt_convert_efi_name_to_char(char *s, efi_char16_t *es, int n)
}
}
-int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
+int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
gpt_entry **gpt_pte)
{
/*
@@ -619,7 +619,7 @@ int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
return 0;
}
-int gpt_verify_partitions(block_dev_desc_t *dev_desc,
+int gpt_verify_partitions(struct blk_desc *dev_desc,
disk_partition_t *partitions, int parts,
gpt_header *gpt_head, gpt_entry **gpt_pte)
{
@@ -691,7 +691,7 @@ int gpt_verify_partitions(block_dev_desc_t *dev_desc,
return 0;
}
-int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf)
+int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf)
{
gpt_header *gpt_h;
gpt_entry *gpt_e;
@@ -712,7 +712,7 @@ int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf)
return 0;
}
-int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf)
+int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf)
{
gpt_header *gpt_h;
gpt_entry *gpt_e;
@@ -834,7 +834,7 @@ static int is_pmbr_valid(legacy_mbr * mbr)
* Description: returns 1 if valid, 0 on error.
* If valid, returns pointers to PTEs.
*/
-static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba,
+static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
gpt_header *pgpt_head, gpt_entry **pgpt_pte)
{
if (!dev_desc || !pgpt_head) {
@@ -876,8 +876,8 @@ static int is_gpt_valid(block_dev_desc_t *dev_desc, u64 lba,
* Allocates space for PTEs based on information found in @gpt.
* Notes: remember to free pte when you're done!
*/
-static gpt_entry *alloc_read_gpt_entries(block_dev_desc_t * dev_desc,
- gpt_header * pgpt_head)
+static gpt_entry *alloc_read_gpt_entries(struct blk_desc *dev_desc,
+ gpt_header *pgpt_head)
{
size_t count = 0, blk_cnt;
lbaint_t blk;
diff --git a/disk/part_iso.c b/disk/part_iso.c
index 5f4bb18..2984df5 100644
--- a/disk/part_iso.c
+++ b/disk/part_iso.c
@@ -46,7 +46,8 @@ static inline unsigned short le16_to_int(unsigned char *le16)
/* only boot records will be listed as valid partitions */
-int get_partition_info_iso_verb(block_dev_desc_t * dev_desc, int part_num, disk_partition_t * info, int verb)
+int get_partition_info_iso_verb(struct blk_desc *dev_desc, int part_num,
+ disk_partition_t *info, int verb)
{
int i,offset,entry_num;
unsigned short *chksumbuf;
@@ -216,13 +217,14 @@ found:
return 0;
}
-int get_partition_info_iso(block_dev_desc_t * dev_desc, int part_num, disk_partition_t * info)
+int get_partition_info_iso(struct blk_desc *dev_desc, int part_num,
+ disk_partition_t *info)
{
return(get_partition_info_iso_verb(dev_desc, part_num, info, 1));
}
-void print_part_iso(block_dev_desc_t * dev_desc)
+void print_part_iso(struct blk_desc *dev_desc)
{
disk_partition_t info;
int i;
@@ -239,7 +241,7 @@ void print_part_iso(block_dev_desc_t * dev_desc)
} while (get_partition_info_iso_verb(dev_desc,i,&info,0)!=-1);
}
-int test_part_iso (block_dev_desc_t *dev_desc)
+int test_part_iso(struct blk_desc *dev_desc)
{
disk_partition_t info;
diff --git a/disk/part_mac.c b/disk/part_mac.c
index f3bc8dd..ae83495 100644
--- a/disk/part_mac.c
+++ b/disk/part_mac.c
@@ -32,13 +32,15 @@ extern ldiv_t ldiv (long int __numer, long int __denom);
#endif
-static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb_p);
-static int part_mac_read_pdb (block_dev_desc_t *dev_desc, int part, mac_partition_t *pdb_p);
+static int part_mac_read_ddb(struct blk_desc *dev_desc,
+ mac_driver_desc_t *ddb_p);
+static int part_mac_read_pdb(struct blk_desc *dev_desc, int part,
+ mac_partition_t *pdb_p);
/*
* Test for a valid MAC partition
*/
-int test_part_mac (block_dev_desc_t *dev_desc)
+int test_part_mac(struct blk_desc *dev_desc)
{
ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1);
ALLOC_CACHE_ALIGN_BUFFER(mac_partition_t, mpart, 1);
@@ -63,7 +65,7 @@ int test_part_mac (block_dev_desc_t *dev_desc)
}
-void print_part_mac (block_dev_desc_t *dev_desc)
+void print_part_mac(struct blk_desc *dev_desc)
{
ulong i, n;
ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1);
@@ -149,7 +151,8 @@ void print_part_mac (block_dev_desc_t *dev_desc)
/*
* Read Device Descriptor Block
*/
-static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb_p)
+static int part_mac_read_ddb(struct blk_desc *dev_desc,
+ mac_driver_desc_t *ddb_p)
{
if (dev_desc->block_read(dev_desc, 0, 1, (ulong *)ddb_p) != 1) {
printf ("** Can't read Driver Desriptor Block **\n");
@@ -169,7 +172,8 @@ static int part_mac_read_ddb (block_dev_desc_t *dev_desc, mac_driver_desc_t *ddb
/*
* Read Partition Descriptor Block
*/
-static int part_mac_read_pdb (block_dev_desc_t *dev_desc, int part, mac_partition_t *pdb_p)
+static int part_mac_read_pdb(struct blk_desc *dev_desc, int part,
+ mac_partition_t *pdb_p)
{
int n = 1;
@@ -210,7 +214,8 @@ static int part_mac_read_pdb (block_dev_desc_t *dev_desc, int part, mac_partitio
/* NOTREACHED */
}
-int get_partition_info_mac (block_dev_desc_t *dev_desc, int part, disk_partition_t *info)
+int get_partition_info_mac(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info)
{
ALLOC_CACHE_ALIGN_BUFFER(mac_driver_desc_t, ddesc, 1);
ALLOC_CACHE_ALIGN_BUFFER(mac_partition_t, mpart, 1);
diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c
index bc072f3..6ec52a9 100644
--- a/drivers/block/dwc_ahsata.c
+++ b/drivers/block/dwc_ahsata.c
@@ -620,7 +620,7 @@ int reset_sata(int dev)
static void dwc_ahsata_print_info(int dev)
{
- block_dev_desc_t *pdev = &(sata_dev_desc[dev]);
+ struct blk_desc *pdev = &(sata_dev_desc[dev]);
printf("SATA Device Info:\n\r");
#ifdef CONFIG_SYS_64BIT_LBA
@@ -956,7 +956,7 @@ int scan_sata(int dev)
struct ahci_probe_ent *probe_ent =
(struct ahci_probe_ent *)sata_dev_desc[dev].priv;
u8 port = probe_ent->hard_port_no;
- block_dev_desc_t *pdev = &(sata_dev_desc[dev]);
+ struct blk_desc *pdev = &(sata_dev_desc[dev]);
id = (u16 *)memalign(ARCH_DMA_MINALIGN,
roundup(ARCH_DMA_MINALIGN,
diff --git a/drivers/block/sandbox.c b/drivers/block/sandbox.c
index 170f0fa..dd21400 100644
--- a/drivers/block/sandbox.c
+++ b/drivers/block/sandbox.c
@@ -22,7 +22,7 @@ static struct host_block_dev *find_host_device(int dev)
return NULL;
}
-static unsigned long host_block_read(block_dev_desc_t *block_dev,
+static unsigned long host_block_read(struct blk_desc *block_dev,
unsigned long start, lbaint_t blkcnt,
void *buffer)
{
@@ -44,7 +44,7 @@ static unsigned long host_block_read(block_dev_desc_t *block_dev,
return -1;
}
-static unsigned long host_block_write(block_dev_desc_t *block_dev,
+static unsigned long host_block_write(struct blk_desc *block_dev,
unsigned long start, lbaint_t blkcnt,
const void *buffer)
{
@@ -89,7 +89,7 @@ int host_dev_bind(int dev, char *filename)
return 1;
}
- block_dev_desc_t *blk_dev = &host_dev->blk_dev;
+ struct blk_desc *blk_dev = &host_dev->blk_dev;
blk_dev->if_type = IF_TYPE_HOST;
blk_dev->priv = host_dev;
blk_dev->blksz = 512;
@@ -103,7 +103,7 @@ int host_dev_bind(int dev, char *filename)
return 0;
}
-int host_get_dev_err(int dev, block_dev_desc_t **blk_devp)
+int host_get_dev_err(int dev, struct blk_desc **blk_devp)
{
struct host_block_dev *host_dev = find_host_device(dev);
@@ -117,9 +117,9 @@ int host_get_dev_err(int dev, block_dev_desc_t **blk_devp)
return 0;
}
-block_dev_desc_t *host_get_dev(int dev)
+struct blk_desc *host_get_dev(int dev)
{
- block_dev_desc_t *blk_dev;
+ struct blk_desc *blk_dev;
if (host_get_dev_err(dev, &blk_dev))
return NULL;
diff --git a/drivers/block/systemace.c b/drivers/block/systemace.c
index b974e80..ea18c0d 100644
--- a/drivers/block/systemace.c
+++ b/drivers/block/systemace.c
@@ -69,11 +69,11 @@ static u16 ace_readw(unsigned off)
return in16(base + off);
}
-static unsigned long systemace_read(block_dev_desc_t *block_dev,
+static unsigned long systemace_read(struct blk_desc *block_dev,
unsigned long start, lbaint_t blkcnt,
void *buffer);
-static block_dev_desc_t systemace_dev = { 0 };
+static struct blk_desc systemace_dev = { 0 };
static int get_cf_lock(void)
{
@@ -105,7 +105,7 @@ static void release_cf_lock(void)
}
#ifdef CONFIG_PARTITIONS
-block_dev_desc_t *systemace_get_dev(int dev)
+struct blk_desc *systemace_get_dev(int dev)
{
/* The first time through this, the systemace_dev object is
not yet initialized. In that case, fill it in. */
@@ -137,7 +137,7 @@ block_dev_desc_t *systemace_get_dev(int dev)
* the dev_desc) to read blocks of data. The return value is the
* number of blocks read. A zero return indicates an error.
*/
-static unsigned long systemace_read(block_dev_desc_t *block_dev,
+static unsigned long systemace_read(struct blk_desc *block_dev,
unsigned long start, lbaint_t blkcnt,
void *buffer)
{
diff --git a/drivers/dfu/dfu_mmc.c b/drivers/dfu/dfu_mmc.c
index 395d472..bfac91a 100644
--- a/drivers/dfu/dfu_mmc.c
+++ b/drivers/dfu/dfu_mmc.c
@@ -351,7 +351,7 @@ int dfu_fill_entity_mmc(struct dfu_entity *dfu, char *devstr, char *s)
} else if (!strcmp(entity_type, "part")) {
disk_partition_t partinfo;
- block_dev_desc_t *blk_dev = &mmc->block_dev;
+ struct blk_desc *blk_dev = &mmc->block_dev;
int mmcdev = second_arg;
int mmcpart = third_arg;
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index ede5d6e..b19b328 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -234,7 +234,7 @@ static int mmc_read_blocks(struct mmc *mmc, void *dst, lbaint_t start,
return blkcnt;
}
-static ulong mmc_bread(block_dev_desc_t *block_dev, lbaint_t start,
+static ulong mmc_bread(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt, void *dst)
{
int dev_num = block_dev->dev;
@@ -1579,7 +1579,7 @@ void mmc_destroy(struct mmc *mmc)
}
#ifdef CONFIG_PARTITIONS
-block_dev_desc_t *mmc_get_dev(int dev)
+struct blk_desc *mmc_get_dev(int dev)
{
struct mmc *mmc = find_mmc_device(dev);
if (!mmc || mmc_init(mmc))
diff --git a/drivers/mmc/mmc_private.h b/drivers/mmc/mmc_private.h
index 6a70639..d3f6bfe 100644
--- a/drivers/mmc/mmc_private.h
+++ b/drivers/mmc/mmc_private.h
@@ -22,23 +22,23 @@ void mmc_adapter_card_type_ident(void);
#ifndef CONFIG_SPL_BUILD
-unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start,
+unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt);
-unsigned long mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
+unsigned long mmc_bwrite(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt, const void *src);
#else /* CONFIG_SPL_BUILD */
/* SPL will never write or erase, declare dummies to reduce code size. */
-static inline unsigned long mmc_berase(block_dev_desc_t *block_dev,
+static inline unsigned long mmc_berase(struct blk_desc *block_dev,
lbaint_t start, lbaint_t blkcnt)
{
return 0;
}
-static inline ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start,
+static inline ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt, const void *src)
{
return 0;
diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
index 79b8c4d..54e60db 100644
--- a/drivers/mmc/mmc_write.c
+++ b/drivers/mmc/mmc_write.c
@@ -65,7 +65,7 @@ err_out:
return err;
}
-unsigned long mmc_berase(block_dev_desc_t *block_dev, lbaint_t start,
+unsigned long mmc_berase(struct blk_desc *block_dev, lbaint_t start,
lbaint_t blkcnt)
{
int dev_num = block_dev->dev;
@@ -171,7 +171,7 @@ static ulong mmc_write_blocks(struct mmc *mmc, lbaint_t start,
return blkcnt;
}
-ulong mmc_bwrite(block_dev_desc_t *block_dev, lbaint_t start, lbaint_t blkcnt,
+ulong mmc_bwrite(struct blk_desc *block_dev, lbaint_t start, lbaint_t blkcnt,
const void *src)
{
int dev_num = block_dev->dev;
diff --git a/fs/ext4/dev.c b/fs/ext4/dev.c
index 9fd10de..3eef66f 100644
--- a/fs/ext4/dev.c
+++ b/fs/ext4/dev.c
@@ -32,13 +32,13 @@
lbaint_t part_offset;
-static block_dev_desc_t *ext4fs_block_dev_desc;
+static struct blk_desc *ext4fs_blk_desc;
static disk_partition_t *part_info;
-void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
+void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
{
assert(rbdd->blksz == (1 << rbdd->log2blksz));
- ext4fs_block_dev_desc = rbdd;
+ ext4fs_blk_desc = rbdd;
get_fs()->dev_desc = rbdd;
part_info = info;
part_offset = info->start;
@@ -49,11 +49,11 @@ void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
{
unsigned block_len;
- int log2blksz = ext4fs_block_dev_desc->log2blksz;
- ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (ext4fs_block_dev_desc ?
- ext4fs_block_dev_desc->blksz :
+ int log2blksz = ext4fs_blk_desc->log2blksz;
+ ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, (ext4fs_blk_desc ?
+ ext4fs_blk_desc->blksz :
0));
- if (ext4fs_block_dev_desc == NULL) {
+ if (ext4fs_blk_desc == NULL) {
printf("** Invalid Block Device Descriptor (NULL)\n");
return 0;
}
@@ -69,21 +69,20 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
/* Get the read to the beginning of a partition */
sector += byte_offset >> log2blksz;
- byte_offset &= ext4fs_block_dev_desc->blksz - 1;
+ byte_offset &= ext4fs_blk_desc->blksz - 1;
debug(" <" LBAFU ", %d, %d>\n", sector, byte_offset, byte_len);
if (byte_offset != 0) {
int readlen;
/* read first part which isn't aligned with start of sector */
- if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
- part_info->start + sector,
- 1, (void *)sec_buf)
- != 1) {
+ if (ext4fs_blk_desc->block_read(ext4fs_blk_desc,
+ part_info->start + sector,
+ 1, (void *)sec_buf) != 1) {
printf(" ** ext2fs_devread() read error **\n");
return 0;
}
- readlen = min((int)ext4fs_block_dev_desc->blksz - byte_offset,
+ readlen = min((int)ext4fs_blk_desc->blksz - byte_offset,
byte_len);
memcpy(buf, sec_buf + byte_offset, readlen);
buf += readlen;
@@ -95,38 +94,36 @@ int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf)
return 1;
/* read sector aligned part */
- block_len = byte_len & ~(ext4fs_block_dev_desc->blksz - 1);
+ block_len = byte_len & ~(ext4fs_blk_desc->blksz - 1);
if (block_len == 0) {
- ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_block_dev_desc->blksz);
+ ALLOC_CACHE_ALIGN_BUFFER(u8, p, ext4fs_blk_desc->blksz);
- block_len = ext4fs_block_dev_desc->blksz;
- ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
+ block_len = ext4fs_blk_desc->blksz;
+ ext4fs_blk_desc->block_read(ext4fs_blk_desc,
part_info->start + sector,
1, (void *)p);
memcpy(buf, p, byte_len);
return 1;
}
- if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
- part_info->start + sector,
- block_len >> log2blksz,
- (void *)buf) !=
- block_len >> log2blksz) {
+ if (ext4fs_blk_desc->block_read(ext4fs_blk_desc,
+ part_info->start + sector,
+ block_len >> log2blksz, (void *)buf)
+ != block_len >> log2blksz) {
printf(" ** %s read error - block\n", __func__);
return 0;
}
- block_len = byte_len & ~(ext4fs_block_dev_desc->blksz - 1);
+ block_len = byte_len & ~(ext4fs_blk_desc->blksz - 1);
buf += block_len;
byte_len -= block_len;
- sector += block_len / ext4fs_block_dev_desc->blksz;
+ sector += block_len / ext4fs_blk_desc->blksz;
if (byte_len != 0) {
/* read rest of data which are not in whole sector */
- if (ext4fs_block_dev_desc->block_read(ext4fs_block_dev_desc,
- part_info->start + sector,
- 1, (void *)sec_buf)
- != 1) {
+ if (ext4fs_blk_desc->block_read(ext4fs_blk_desc,
+ part_info->start + sector,
+ 1, (void *)sec_buf) != 1) {
printf("* %s read error - last part\n", __func__);
return 0;
}
diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c
index 258b937..43c8897 100644
--- a/fs/ext4/ext4fs.c
+++ b/fs/ext4/ext4fs.c
@@ -198,7 +198,7 @@ int ext4fs_read(char *buf, loff_t len, loff_t *actread)
return ext4fs_read_file(ext4fs_file, 0, len, buf, actread);
}
-int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
+int ext4fs_probe(struct blk_desc *fs_dev_desc,
disk_partition_t *fs_partition)
{
ext4fs_set_blk_dev(fs_dev_desc, fs_partition);
diff --git a/fs/fat/fat.c b/fs/fat/fat.c
index 472a63e..2cef3bd 100644
--- a/fs/fat/fat.c
+++ b/fs/fat/fat.c
@@ -37,7 +37,7 @@ static void downcase(char *str)
}
}
-static block_dev_desc_t *cur_dev;
+static struct blk_desc *cur_dev;
static disk_partition_t cur_part_info;
#define DOS_BOOT_MAGIC_OFFSET 0x1fe
@@ -60,7 +60,7 @@ static int disk_read(__u32 block, __u32 nr_blocks, void *buf)
return ret;
}
-int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info)
+int fat_set_blk_dev(struct blk_desc *dev_desc, disk_partition_t *info)
{
ALLOC_CACHE_ALIGN_BUFFER(unsigned char, buffer, dev_desc->blksz);
@@ -89,7 +89,7 @@ int fat_set_blk_dev(block_dev_desc_t *dev_desc, disk_partition_t *info)
return -1;
}
-int fat_register_device(block_dev_desc_t *dev_desc, int part_no)
+int fat_register_device(struct blk_desc *dev_desc, int part_no)
{
disk_partition_t info;
diff --git a/fs/fs.c b/fs/fs.c
index d123d29..8515bea 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -20,11 +20,11 @@
DECLARE_GLOBAL_DATA_PTR;
-static block_dev_desc_t *fs_dev_desc;
+static struct blk_desc *fs_dev_desc;
static disk_partition_t fs_partition;
static int fs_type = FS_TYPE_ANY;
-static inline int fs_probe_unsupported(block_dev_desc_t *fs_dev_desc,
+static inline int fs_probe_unsupported(struct blk_desc *fs_dev_desc,
disk_partition_t *fs_partition)
{
printf("** Unrecognized filesystem type **\n");
@@ -81,7 +81,7 @@ struct fstype_info {
* filesystem.
*/
bool null_dev_desc_ok;
- int (*probe)(block_dev_desc_t *fs_dev_desc,
+ int (*probe)(struct blk_desc *fs_dev_desc,
disk_partition_t *fs_partition);
int (*ls)(const char *dirname);
int (*exists)(const char *filename);
diff --git a/fs/reiserfs/dev.c b/fs/reiserfs/dev.c
index 7b24d6a..5a1ab0a 100644
--- a/fs/reiserfs/dev.c
+++ b/fs/reiserfs/dev.c
@@ -12,13 +12,13 @@
#include "reiserfs_private.h"
-static block_dev_desc_t *reiserfs_block_dev_desc;
+static struct blk_desc *reiserfs_blk_desc;
static disk_partition_t *part_info;
-void reiserfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
+void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
{
- reiserfs_block_dev_desc = rbdd;
+ reiserfs_blk_desc = rbdd;
part_info = info;
}
@@ -53,17 +53,15 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
#endif
- if (reiserfs_block_dev_desc == NULL)
+ if (reiserfs_blk_desc == NULL)
return 0;
if (byte_offset != 0) {
/* read first part which isn't aligned with start of sector */
- if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
- part_info->start +
- sector,
- 1, (void *)sec_buf)
- != 1) {
+ if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
+ part_info->start + sector,
+ 1, (void *)sec_buf) != 1) {
printf (" ** reiserfs_devread() read error\n");
return 0;
}
@@ -75,11 +73,10 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
/* read sector aligned part */
block_len = byte_len & ~(SECTOR_SIZE-1);
- if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
- part_info->start + sector,
- block_len / SECTOR_SIZE,
- (void *)buf)
- != block_len/SECTOR_SIZE) {
+ if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
+ part_info->start + sector,
+ block_len / SECTOR_SIZE, (void *)buf)
+ != block_len/SECTOR_SIZE) {
printf (" ** reiserfs_devread() read error - block\n");
return 0;
}
@@ -89,11 +86,9 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
if ( byte_len != 0 ) {
/* read rest of data which are not in whole sector */
- if (reiserfs_block_dev_desc->block_read(reiserfs_block_dev_desc,
- part_info->start +
- sector,
- 1, (void *)sec_buf)
- != 1) {
+ if (reiserfs_blk_desc->block_read(reiserfs_blk_desc,
+ part_info->start + sector,
+ 1, (void *)sec_buf) != 1) {
printf (" ** reiserfs_devread() read error - last part\n");
return 0;
}
diff --git a/fs/sandbox/sandboxfs.c b/fs/sandbox/sandboxfs.c
index 5acfc03..2703eed 100644
--- a/fs/sandbox/sandboxfs.c
+++ b/fs/sandbox/sandboxfs.c
@@ -8,10 +8,10 @@
#include <fs.h>
#include <os.h>
-int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
+int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
{
/*
- * Only accept a NULL block_dev_desc_t for the sandbox, which is when
+ * Only accept a NULL struct blk_desc for the sandbox, which is when
* hostfs interface is used
*/
return rbdd != NULL;
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index a992a00..168ae2b 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -561,7 +561,7 @@ static unsigned long ubifs_findfile(struct super_block *sb, char *filename)
return 0;
}
-int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
+int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
{
if (rbdd) {
debug("UBIFS cannot be used with normal block devices\n");
diff --git a/fs/zfs/dev.c b/fs/zfs/dev.c
index 67d1265..2f409e6 100644
--- a/fs/zfs/dev.c
+++ b/fs/zfs/dev.c
@@ -13,12 +13,12 @@
#include <config.h>
#include <zfs_common.h>
-static block_dev_desc_t *zfs_block_dev_desc;
+static struct blk_desc *zfs_blk_desc;
static disk_partition_t *part_info;
-void zfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info)
+void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info)
{
- zfs_block_dev_desc = rbdd;
+ zfs_blk_desc = rbdd;
part_info = info;
}
@@ -48,17 +48,16 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
debug(" <%d, %d, %d>\n", sector, byte_offset, byte_len);
- if (zfs_block_dev_desc == NULL) {
+ if (zfs_blk_desc == NULL) {
printf("** Invalid Block Device Descriptor (NULL)\n");
return 1;
}
if (byte_offset != 0) {
/* read first part which isn't aligned with start of sector */
- if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
- part_info->start + sector, 1,
- (void *)sec_buf)
- != 1) {
+ if (zfs_blk_desc->block_read(zfs_blk_desc,
+ part_info->start + sector, 1,
+ (void *)sec_buf) != 1) {
printf(" ** zfs_devread() read error **\n");
return 1;
}
@@ -79,18 +78,16 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
u8 p[SECTOR_SIZE];
block_len = SECTOR_SIZE;
- zfs_block_dev_desc->block_read(zfs_block_dev_desc,
- part_info->start + sector,
- 1, (void *)p);
+ zfs_blk_desc->block_read(zfs_blk_desc,
+ part_info->start + sector,
+ 1, (void *)p);
memcpy(buf, p, byte_len);
return 0;
}
- if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
- part_info->start + sector,
- block_len / SECTOR_SIZE,
- (void *)buf)
- != block_len / SECTOR_SIZE) {
+ if (zfs_blk_desc->block_read(zfs_blk_desc, part_info->start + sector,
+ block_len / SECTOR_SIZE,
+ (void *)buf) != block_len / SECTOR_SIZE) {
printf(" ** zfs_devread() read error - block\n");
return 1;
}
@@ -102,9 +99,9 @@ int zfs_devread(int sector, int byte_offset, int byte_len, char *buf)
if (byte_len != 0) {
/* read rest of data which are not in whole sector */
- if (zfs_block_dev_desc->block_read(zfs_block_dev_desc,
- part_info->start + sector,
- 1, (void *)sec_buf) != 1) {
+ if (zfs_blk_desc->block_read(zfs_blk_desc,
+ part_info->start + sector,
+ 1, (void *)sec_buf) != 1) {
printf(" ** zfs_devread() read error - last part\n");
return 1;
}
diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c
index fb2b3ee..ca67afb 100644
--- a/fs/zfs/zfs.c
+++ b/fs/zfs/zfs.c
@@ -20,7 +20,7 @@
#include "zfs_common.h"
#include "div64.h"
-block_dev_desc_t *zfs_dev_desc;
+struct blk_desc *zfs_dev_desc;
/*
* The zfs plug-in routines for GRUB are:
diff --git a/include/common.h b/include/common.h
index 1563d64..1317f9b 100644
--- a/include/common.h
+++ b/include/common.h
@@ -813,7 +813,7 @@ void gzwrite_progress_finish(int retcode,
* for files under 4GiB
*/
int gzwrite(unsigned char *src, int len,
- struct block_dev_desc *dev,
+ struct blk_desc *dev,
unsigned long szwritebuf,
u64 startoffs,
u64 szexpected);
diff --git a/include/ext4fs.h b/include/ext4fs.h
index 6888adc..cc765ae 100644
--- a/include/ext4fs.h
+++ b/include/ext4fs.h
@@ -110,7 +110,7 @@ struct ext_filesystem {
/* Journal Related */
/* Block Device Descriptor */
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
};
extern struct ext2_data *ext4fs_root;
@@ -141,9 +141,9 @@ int ext4fs_exists(const char *filename);
int ext4fs_size(const char *filename, loff_t *size);
void ext4fs_free_node(struct ext2fs_node *node, struct ext2fs_node *currroot);
int ext4fs_devread(lbaint_t sector, int byte_offset, int byte_len, char *buf);
-void ext4fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+void ext4fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
long int read_allocated_block(struct ext2_inode *inode, int fileblock);
-int ext4fs_probe(block_dev_desc_t *fs_dev_desc,
+int ext4fs_probe(struct blk_desc *fs_dev_desc,
disk_partition_t *fs_partition);
int ext4_read_file(const char *filename, void *buf, loff_t offset, loff_t len,
loff_t *actread);
diff --git a/include/fat.h b/include/fat.h
index 3038bd7..9d053e6 100644
--- a/include/fat.h
+++ b/include/fat.h
@@ -203,8 +203,8 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
loff_t maxsize, loff_t *actread);
int file_fat_read(const char *filename, void *buffer, int maxsize);
const char *file_getfsname(int idx);
-int fat_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
-int fat_register_device(block_dev_desc_t *dev_desc, int part_no);
+int fat_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
+int fat_register_device(struct blk_desc *dev_desc, int part_no);
int file_fat_write(const char *filename, void *buf, loff_t offset, loff_t len,
loff_t *actwrite);
diff --git a/include/ide.h b/include/ide.h
index f9357be..2407393 100644
--- a/include/ide.h
+++ b/include/ide.h
@@ -41,10 +41,10 @@ typedef ulong lbaint_t;
*/
void ide_init(void);
-typedef struct block_dev_desc block_dev_desc_t;
-ulong ide_read(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+struct blk_desc;
+ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
void *buffer);
-ulong ide_write(block_dev_desc_t *block_dev, lbaint_t blknr, lbaint_t blkcnt,
+ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
const void *buffer);
#ifdef CONFIG_IDE_PREINIT
diff --git a/include/mmc.h b/include/mmc.h
index d652c14..cdb56e7 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -376,7 +376,7 @@ struct mmc {
u64 capacity_gp[4];
u64 enh_user_start;
u64 enh_user_size;
- block_dev_desc_t block_dev;
+ struct blk_desc block_dev;
char op_cond_pending; /* 1 if we are waiting on an op_cond command */
char init_in_progress; /* 1 if we have done mmc_start_init() */
char preinit; /* start init as early as possible */
diff --git a/include/part.h b/include/part.h
index dc23949..d1e9d0f 100644
--- a/include/part.h
+++ b/include/part.h
@@ -10,7 +10,7 @@
#include <ide.h>
#include <common.h>
-struct block_dev_desc {
+struct blk_desc {
int if_type; /* type of the interface */
int dev; /* device number */
unsigned char part_type; /* partition type */
@@ -28,23 +28,23 @@ struct block_dev_desc {
char vendor [40+1]; /* IDE model, SCSI Vendor */
char product[20+1]; /* IDE Serial no, SCSI product */
char revision[8+1]; /* firmware revision */
- unsigned long (*block_read)(block_dev_desc_t *block_dev,
+ unsigned long (*block_read)(struct blk_desc *block_dev,
lbaint_t start,
lbaint_t blkcnt,
void *buffer);
- unsigned long (*block_write)(block_dev_desc_t *block_dev,
+ unsigned long (*block_write)(struct blk_desc *block_dev,
lbaint_t start,
lbaint_t blkcnt,
const void *buffer);
- unsigned long (*block_erase)(block_dev_desc_t *block_dev,
+ unsigned long (*block_erase)(struct blk_desc *block_dev,
lbaint_t start,
lbaint_t blkcnt);
void *priv; /* driver private struct pointer */
};
-#define BLOCK_CNT(size, block_dev_desc) (PAD_COUNT(size, block_dev_desc->blksz))
-#define PAD_TO_BLOCKSIZE(size, block_dev_desc) \
- (PAD_SIZE(size, block_dev_desc->blksz))
+#define BLOCK_CNT(size, blk_desc) (PAD_COUNT(size, blk_desc->blksz))
+#define PAD_TO_BLOCKSIZE(size, blk_desc) \
+ (PAD_SIZE(size, blk_desc->blksz))
#define LOG2(x) (((x & 0xaaaaaaaa) ? 1 : 0) + ((x & 0xcccccccc) ? 2 : 0) + \
((x & 0xf0f0f0f0) ? 4 : 0) + ((x & 0xff00ff00) ? 8 : 0) + \
((x & 0xffff0000) ? 16 : 0))
@@ -101,52 +101,53 @@ typedef struct disk_partition {
/* Misc _get_dev functions */
#ifdef CONFIG_PARTITIONS
-block_dev_desc_t *get_dev(const char *ifname, int dev);
-block_dev_desc_t* ide_get_dev(int dev);
-block_dev_desc_t* sata_get_dev(int dev);
-block_dev_desc_t* scsi_get_dev(int dev);
-block_dev_desc_t* usb_stor_get_dev(int dev);
-block_dev_desc_t* mmc_get_dev(int dev);
+struct blk_desc *get_dev(const char *ifname, int dev);
+struct blk_desc *ide_get_dev(int dev);
+struct blk_desc *sata_get_dev(int dev);
+struct blk_desc *scsi_get_dev(int dev);
+struct blk_desc *usb_stor_get_dev(int dev);
+struct blk_desc *mmc_get_dev(int dev);
int mmc_select_hwpart(int dev_num, int hwpart);
-block_dev_desc_t* systemace_get_dev(int dev);
-block_dev_desc_t* mg_disk_get_dev(int dev);
-block_dev_desc_t *host_get_dev(int dev);
-int host_get_dev_err(int dev, block_dev_desc_t **blk_devp);
+struct blk_desc *systemace_get_dev(int dev);
+struct blk_desc *mg_disk_get_dev(int dev);
+struct blk_desc *host_get_dev(int dev);
+int host_get_dev_err(int dev, struct blk_desc **blk_devp);
/* disk/part.c */
-int get_partition_info (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part (block_dev_desc_t *dev_desc);
-void init_part (block_dev_desc_t *dev_desc);
-void dev_print(block_dev_desc_t *dev_desc);
+int get_partition_info(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part(struct blk_desc *dev_desc);
+void init_part(struct blk_desc *dev_desc);
+void dev_print(struct blk_desc *dev_desc);
int get_device(const char *ifname, const char *dev_str,
- block_dev_desc_t **dev_desc);
+ struct blk_desc **dev_desc);
int get_device_and_partition(const char *ifname, const char *dev_part_str,
- block_dev_desc_t **dev_desc,
+ struct blk_desc **dev_desc,
disk_partition_t *info, int allow_whole_dev);
#else
-static inline block_dev_desc_t *get_dev(const char *ifname, int dev)
+static inline struct blk_desc *get_dev(const char *ifname, int dev)
{ return NULL; }
-static inline block_dev_desc_t* ide_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* sata_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* scsi_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* usb_stor_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* mmc_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *ide_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *sata_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *scsi_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *usb_stor_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *mmc_get_dev(int dev) { return NULL; }
static inline int mmc_select_hwpart(int dev_num, int hwpart) { return -1; }
-static inline block_dev_desc_t* systemace_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t* mg_disk_get_dev(int dev) { return NULL; }
-static inline block_dev_desc_t *host_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *systemace_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *mg_disk_get_dev(int dev) { return NULL; }
+static inline struct blk_desc *host_get_dev(int dev) { return NULL; }
-static inline int get_partition_info (block_dev_desc_t * dev_desc, int part,
- disk_partition_t *info) { return -1; }
-static inline void print_part (block_dev_desc_t *dev_desc) {}
-static inline void init_part (block_dev_desc_t *dev_desc) {}
-static inline void dev_print(block_dev_desc_t *dev_desc) {}
+static inline int get_partition_info(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info) { return -1; }
+static inline void print_part(struct blk_desc *dev_desc) {}
+static inline void init_part(struct blk_desc *dev_desc) {}
+static inline void dev_print(struct blk_desc *dev_desc) {}
static inline int get_device(const char *ifname, const char *dev_str,
- block_dev_desc_t **dev_desc)
+ struct blk_desc **dev_desc)
{ return -1; }
static inline int get_device_and_partition(const char *ifname,
const char *dev_part_str,
- block_dev_desc_t **dev_desc,
+ struct blk_desc **dev_desc,
disk_partition_t *info,
int allow_whole_dev)
{ *dev_desc = NULL; return -1; }
@@ -154,36 +155,41 @@ static inline int get_device_and_partition(const char *ifname,
#ifdef CONFIG_MAC_PARTITION
/* disk/part_mac.c */
-int get_partition_info_mac (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_mac (block_dev_desc_t *dev_desc);
-int test_part_mac (block_dev_desc_t *dev_desc);
+int get_partition_info_mac(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part_mac(struct blk_desc *dev_desc);
+int test_part_mac(struct blk_desc *dev_desc);
#endif
#ifdef CONFIG_DOS_PARTITION
/* disk/part_dos.c */
-int get_partition_info_dos (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_dos (block_dev_desc_t *dev_desc);
-int test_part_dos (block_dev_desc_t *dev_desc);
+int get_partition_info_dos(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part_dos(struct blk_desc *dev_desc);
+int test_part_dos(struct blk_desc *dev_desc);
#endif
#ifdef CONFIG_ISO_PARTITION
/* disk/part_iso.c */
-int get_partition_info_iso (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_iso (block_dev_desc_t *dev_desc);
-int test_part_iso (block_dev_desc_t *dev_desc);
+int get_partition_info_iso(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part_iso(struct blk_desc *dev_desc);
+int test_part_iso(struct blk_desc *dev_desc);
#endif
#ifdef CONFIG_AMIGA_PARTITION
/* disk/part_amiga.c */
-int get_partition_info_amiga (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
-void print_part_amiga (block_dev_desc_t *dev_desc);
-int test_part_amiga (block_dev_desc_t *dev_desc);
+int get_partition_info_amiga(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
+void print_part_amiga(struct blk_desc *dev_desc);
+int test_part_amiga(struct blk_desc *dev_desc);
#endif
#ifdef CONFIG_EFI_PARTITION
#include <part_efi.h>
/* disk/part_efi.c */
-int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partition_t *info);
+int get_partition_info_efi(struct blk_desc *dev_desc, int part,
+ disk_partition_t *info);
/**
* get_partition_info_efi_by_name() - Find the specified GPT partition table entry
*
@@ -193,10 +199,10 @@ int get_partition_info_efi (block_dev_desc_t * dev_desc, int part, disk_partitio
*
* @return - '0' on match, '-1' on no match, otherwise error
*/
-int get_partition_info_efi_by_name(block_dev_desc_t *dev_desc,
+int get_partition_info_efi_by_name(struct blk_desc *dev_desc,
const char *name, disk_partition_t *info);
-void print_part_efi (block_dev_desc_t *dev_desc);
-int test_part_efi (block_dev_desc_t *dev_desc);
+void print_part_efi(struct blk_desc *dev_desc);
+int test_part_efi(struct blk_desc *dev_desc);
/**
* write_gpt_table() - Write the GUID Partition Table to disk
@@ -207,7 +213,7 @@ int test_part_efi (block_dev_desc_t *dev_desc);
*
* @return - zero on success, otherwise error
*/
-int write_gpt_table(block_dev_desc_t *dev_desc,
+int write_gpt_table(struct blk_desc *dev_desc,
gpt_header *gpt_h, gpt_entry *gpt_e);
/**
@@ -233,7 +239,7 @@ int gpt_fill_pte(gpt_header *gpt_h, gpt_entry *gpt_e,
*
* @return - error on str_guid conversion error
*/
-int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
+int gpt_fill_header(struct blk_desc *dev_desc, gpt_header *gpt_h,
char *str_guid, int parts_count);
/**
@@ -246,7 +252,7 @@ int gpt_fill_header(block_dev_desc_t *dev_desc, gpt_header *gpt_h,
*
* @return zero on success
*/
-int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
+int gpt_restore(struct blk_desc *dev_desc, char *str_disk_guid,
disk_partition_t *partitions, const int parts_count);
/**
@@ -257,7 +263,7 @@ int gpt_restore(block_dev_desc_t *dev_desc, char *str_disk_guid,
*
* @return - '0' on success, otherwise error
*/
-int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf);
+int is_valid_gpt_buf(struct blk_desc *dev_desc, void *buf);
/**
* write_mbr_and_gpt_partitions() - write MBR, Primary GPT and Backup GPT
@@ -267,7 +273,7 @@ int is_valid_gpt_buf(block_dev_desc_t *dev_desc, void *buf);
*
* @return - '0' on success, otherwise error
*/
-int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf);
+int write_mbr_and_gpt_partitions(struct blk_desc *dev_desc, void *buf);
/**
* gpt_verify_headers() - Function to read and CRC32 check of the GPT's header
@@ -281,7 +287,7 @@ int write_mbr_and_gpt_partitions(block_dev_desc_t *dev_desc, void *buf);
*
* @return - '0' on success, otherwise error
*/
-int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
+int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head,
gpt_entry **gpt_pte);
/**
@@ -300,7 +306,7 @@ int gpt_verify_headers(block_dev_desc_t *dev_desc, gpt_header *gpt_head,
*
* @return - '0' on success, otherwise error
*/
-int gpt_verify_partitions(block_dev_desc_t *dev_desc,
+int gpt_verify_partitions(struct blk_desc *dev_desc,
disk_partition_t *partitions, int parts,
gpt_header *gpt_head, gpt_entry **gpt_pte);
#endif
diff --git a/include/reiserfs.h b/include/reiserfs.h
index 2d14d48..ffe4e46 100644
--- a/include/reiserfs.h
+++ b/include/reiserfs.h
@@ -63,7 +63,7 @@ typedef enum
} reiserfs_error_t;
-extern void reiserfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+void reiserfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
extern int reiserfs_ls (char *dirname);
extern int reiserfs_open (char *filename);
extern int reiserfs_read (char *buf, unsigned len);
diff --git a/include/sandboxblockdev.h b/include/sandboxblockdev.h
index 627787a..59f9519 100644
--- a/include/sandboxblockdev.h
+++ b/include/sandboxblockdev.h
@@ -8,7 +8,7 @@
#define __SANDBOX_BLOCK_DEV__
struct host_block_dev {
- block_dev_desc_t blk_dev;
+ struct blk_desc blk_dev;
char *filename;
int fd;
};
diff --git a/include/sandboxfs.h b/include/sandboxfs.h
index 4c7745d..6e6e3c6 100644
--- a/include/sandboxfs.h
+++ b/include/sandboxfs.h
@@ -18,7 +18,7 @@
#ifndef __SANDBOX_FS__
#define __SANDBOX_FS__
-int sandbox_fs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+int sandbox_fs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
int sandbox_fs_read_at(const char *filename, loff_t pos, void *buffer,
loff_t maxsize, loff_t *actread);
diff --git a/include/sata.h b/include/sata.h
index fa61da8..b35359a 100644
--- a/include/sata.h
+++ b/include/sata.h
@@ -14,6 +14,6 @@ int sata_stop(void);
int __sata_stop(void);
int sata_port_status(int dev, int port);
-extern block_dev_desc_t sata_dev_desc[];
+extern struct blk_desc sata_dev_desc[];
#endif
diff --git a/include/spl.h b/include/spl.h
index 92cdc04..c62887a 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -72,14 +72,16 @@ int spl_usb_load_image(void);
int spl_sata_load_image(void);
/* SPL FAT image functions */
-int spl_load_image_fat(block_dev_desc_t *block_dev, int partition, const char *filename);
-int spl_load_image_fat_os(block_dev_desc_t *block_dev, int partition);
+int spl_load_image_fat(struct blk_desc *block_dev, int partition,
+ const char *filename);
+int spl_load_image_fat_os(struct blk_desc *block_dev, int partition);
void __noreturn jump_to_image_no_args(struct spl_image_info *spl_image);
/* SPL EXT image functions */
-int spl_load_image_ext(block_dev_desc_t *block_dev, int partition, const char *filename);
-int spl_load_image_ext_os(block_dev_desc_t *block_dev, int partition);
+int spl_load_image_ext(struct blk_desc *block_dev, int partition,
+ const char *filename);
+int spl_load_image_ext_os(struct blk_desc *block_dev, int partition);
/**
* spl_init() - Set up device tree and driver model in SPL if enabled
diff --git a/include/systemace.h b/include/systemace.h
index 3f342d5..3b6ec7d 100644
--- a/include/systemace.h
+++ b/include/systemace.h
@@ -11,7 +11,7 @@
# include <part.h>
-block_dev_desc_t * systemace_get_dev(int dev);
+struct blk_desc *systemace_get_dev(int dev);
#endif /* CONFIG_SYSTEMACE */
#endif /* __SYSTEMACE_H */
diff --git a/include/ubifs_uboot.h b/include/ubifs_uboot.h
index dab433a..d86da27 100644
--- a/include/ubifs_uboot.h
+++ b/include/ubifs_uboot.h
@@ -21,7 +21,7 @@ void uboot_ubifs_umount(void);
int ubifs_is_mounted(void);
int ubifs_load(char *filename, u32 addr, u32 size);
-int ubifs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+int ubifs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
int ubifs_ls(const char *dir_name);
int ubifs_exists(const char *filename);
int ubifs_size(const char *filename, loff_t *size);
diff --git a/include/usb.h b/include/usb.h
index 0b410b6..c2fa684 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -228,7 +228,7 @@ int board_usb_cleanup(int index, enum usb_init_type init);
#ifdef CONFIG_USB_STORAGE
#define USB_MAX_STOR_DEV 7
-block_dev_desc_t *usb_stor_get_dev(int index);
+struct blk_desc *usb_stor_get_dev(int index);
int usb_stor_scan(int mode);
int usb_stor_info(void);
diff --git a/include/usb_mass_storage.h b/include/usb_mass_storage.h
index 5804b70..8229f62 100644
--- a/include/usb_mass_storage.h
+++ b/include/usb_mass_storage.h
@@ -23,7 +23,7 @@ struct ums {
unsigned int start_sector;
unsigned int num_sectors;
const char *name;
- block_dev_desc_t block_dev;
+ struct blk_desc block_dev;
};
int fsg_init(struct ums *ums_devs, int count);
diff --git a/include/zfs_common.h b/include/zfs_common.h
index 3bd575e..bca3dff 100644
--- a/include/zfs_common.h
+++ b/include/zfs_common.h
@@ -63,7 +63,7 @@ enum zfs_errors {
struct zfs_filesystem {
/* Block Device Descriptor */
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
};
struct device_s {
@@ -98,7 +98,7 @@ int zfs_close(zfs_file_t);
int zfs_ls(device_t dev, const char *path,
int (*hook) (const char *, const struct zfs_dirhook_info *));
int zfs_devread(int sector, int byte_offset, int byte_len, char *buf);
-void zfs_set_blk_dev(block_dev_desc_t *rbdd, disk_partition_t *info);
+void zfs_set_blk_dev(struct blk_desc *rbdd, disk_partition_t *info);
void zfs_unmount(struct zfs_data *data);
int lzjb_decompress(void *, void *, uint32_t, uint32_t);
#endif
diff --git a/lib/gunzip.c b/lib/gunzip.c
index da0c76c..6d65ccc 100644
--- a/lib/gunzip.c
+++ b/lib/gunzip.c
@@ -105,7 +105,7 @@ void gzwrite_progress_finish(int returnval,
}
int gzwrite(unsigned char *src, int len,
- struct block_dev_desc *dev,
+ struct blk_desc *dev,
unsigned long szwritebuf,
u64 startoffs,
u64 szexpected)
diff --git a/test/dm/usb.c b/test/dm/usb.c
index 3a2e52b..25cde68 100644
--- a/test/dm/usb.c
+++ b/test/dm/usb.c
@@ -39,7 +39,7 @@ DM_TEST(dm_test_usb_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT);
static int dm_test_usb_flash(struct unit_test_state *uts)
{
struct udevice *dev;
- block_dev_desc_t *dev_desc;
+ struct blk_desc *dev_desc;
char cmp[1024];
state_set_skip_delays(true);
--
2.7.0.rc3.207.g0ac5344
3
67

[U-Boot] [PATCH v2 00/18] Add support for 96boards Dragonboard410C board
by Mateusz Kulikowski 13 Mar '16
by Mateusz Kulikowski 13 Mar '16
13 Mar '16
Hi All,
This is (hopefully) last version of Dragonboard410c series.
As always - for "simplicity" this series is available on my github:
https://github.com/hallor/u-boot/tree/dragonboard-for-mainline-v3
There are almost no changes (none that should break anything):
- Updated dragonboard readme.txt with info on how to stop @ fastboot
- Added SPMI entries into test.dts (so automatic DM tests would not fail)
- Added Tested-by and Reviewed-by Simon (from v2 comments)
- Rebased to recent master
@Simon: Thanks for the tests!
Regards,
Mateusz
V2 cover contents:
This is updated series. 99% of review changes are applied,
specific changes are (as always) include in each patch.
You can find this series on my github (if anyone just want to
try it - that branch has also wait_for_bit applied):
https://github.com/hallor/u-boot/tree/dragonboard-for-mainline-v2
I did target tests on Dragonboard410c, and build tested
platforms that may be affected by ULPI changes.
@Simon:
I decided not to rewrite pm8916_gpio for now, but for sake of
"cleannes" moved offending bindings to separate file (and
they are now properly childs of pm8916_gpio).
I will update it during rework of SoC gpio driver
(I will have to create proper pinmux/pinctrl drivers to
get rid of Little Kernel eventually).
This series still needs wait_for_bit series that is not
included (yet).
V1 cover contents:
I finally managed to cleanup RFC for submission. I've included changes in
each patch, there is a bit of them, but all are needed :)
This series requires wait_for_bit patch that I send few days ago:
https://patchwork.ozlabs.org/patch/561185/
RFC cover contents:
http://lists.denx.de/pipermail/u-boot/2015-December/237365.html
Changes in v3:
- Updated test.dts to include SPMI like sandbox.dts does
- readme: Added info on how to enter fastboot mode and that
dtbTool is also part of skales
Changes in v2:
- Added newline before return... (globally)
- Renamed p to priv (priv data) - it required some rewrapping
- Added Reviewed-by
- Reordered includes (again)
- Added newlines between returns
- Fixed error handling in msm_gpio_probe
- Added reviewed-by
- Add reviewed-by
- Add Reviewed-by (sjg)
- Add better (any) descriptions for Kconfig items.
- New patch, independent of the rest
- Should compile cleanly on all affected platforms
- Is orthogonal to series (i.e. if get's NAK will not break rest of series)
- Add acked-by
- Add reviewed-by
- Add Acked-by
- Use PORT_... macro to write to portsc
- Remove extra whitespace in probe()
- Add acked-by
- Use proper entry order in Kconfig
- Rename CONFIG_DM_SPMI -> CONFIG_SPMI
- Fix header ordering
- Add reviewed-by
- Rename CONFIG_DM_SPMI -> CONFIG_SPMI
- Rename r -> regs, p -> priv
- Add reviewed-by
- Update binding doc (drop unused bindig)
- Rename DM_SPMI -> SPMI
- Rename p -> priv (in write/read)
- Fix header ordering (again)
- Add reviewed-by
- Add reviewed-by
- Reordered Kconfig & Makefile (to keep alphabetical ordering)
- Added link to dt binding @ help
- Add Reviewed-by
- Rename DM_SPMI -> SPMI
- Make MND divider comments more compact :)
- p -> priv
- Add reviewed-by
- Reordered Kconfig to keep alphabetical order
- Renamed reset_sandbox -> msm_reset (typo in reset.c)
- Renamed CONFIG_DM_SPMI -> CONFIG_SPMI
- Removed extra enter in dragonboard file
- Added ULPI* to defconfig
- Added MAINTAINERS to board
- Cleaned up config file - use distro defaults/environment:
- Dropped multiple CONFIG_CMD* and other CONFIG_*
- Added distro env/config
- Dropped old boot commands
- Split dts - pm8916_gpio entries are taken directly from
Linux Dragonboard dts; Add handles for u-boot in -uboot.dtsi;
They will be removed once gpio drivers are converted to pinctrl.
- Renamed some pmic nodes, fixed dragonboard.c to find them properly.
- Added header and converted comments to c98-style in head.S
- Print error if pmic gpio node is not found.
- New patch
Changes in v1:
- Added (better) help to KConfig
- Added dt binding documentation
- Fixed include ordering
- Reworked msm_serial_getc
- Added error handling to msm_uart_clk_init (that is ignored later for now)
- Dropped unneeded DM_FLAG_PRE_RELOC
- Added dt binding documentation
- Added help to KConfig
- Use clrsetbits() to switch direction
- Fixed include order
- Added #defines for registers/register fields
- Added secondary compatible string
- Added commit message
- Added DT binding documentation
- Added Kconfig help
- Reordered includes
- Dropped redundant fields from msm_sdhc
- Cleaned up clock init code (+ added error handling)
- Dropped mdelay - use wait_for_bit instead in reset code
- Added missing newline after declarations
- Added error handling if "reg" is missing
- Converted base address to pointer
- No changes, just added Acked-by, Reviewed-by
- Reordered header files
- Removed braces around constant
- Added more verbose help to KConfig
- Added ULPI dependency to Kconfig
- Drop register #defines - use ehci-ci.h instead
- Create fixed ulpi viewport for device
- Use setbits/clearbits where possible
- Use wait_for_bit to reset controller
- Add dt binding documents
- Reorder includes
- Add read/write arguments documentation
- add binding documentation and better Kconfig help
- Changed a bit mapping
- Change include order
- Use clrsetbits* where possible
- Add one more supported dts id
- Handle missing fields in dt properly
- Added dt bindings
- Reoder includes
- Replaced extract_* macros with ordinary shift/mask
- Added error checking and whitespaces in probe
- Add binding doc
- Fixed inlcude ordering
- Merged direction_input and direction_output functions
- gpio_get: use switch instead of stacked if
- use pmic_clrsetbits
- add possibility to change prwkey bank name
- Handle invalid bindings
- Sanity HW check (i.e. check type/subtype registers)
- Fix include order
- Cleanup defines (added spaces for readibility)
- Base address is integer to avoid casting
- Use setbits_* family where possible
- Drop unneded comments, added newlines where needed
- Check return value of dev_get_addr
- Add binding for apq8016
- Cleaned up divider calculation
- Drop most of gpio.h (only empty file is needed)
- Add better help for dragonboard
- Move static structures to board_prepare_usb
- Add DM_SPMI to defconfig
Mateusz Kulikowski (18):
serial: Add support for Qualcomm serial port
gpio: Add support for Qualcomm gpio controller
mmc: Add support for Qualcomm SDHCI controller
ehci-hcd: Add init_after_reset
usb: ulpi: Add Kconfig options for ULPI
Migrate CONFIG_ULPI* to Kconfig
usb: Rename ehci-fsl.h to ehci-ci.h
usb: ehci-ci: Add missing registers.
ehci-ci.h: drop generic USBCMD fields
ehci: Add support for Qualcomm EHCI
drivers: Add SPMI bus uclass
spmi: Add sandbox test driver
drivers: spmi: Add support for Qualcomm SPMI bus driver
pmic: Add support for Qualcomm PM8916 PMIC
gpio: Add support for Qualcomm PM8916 gpios
arm: Add support for Qualcomm Snapdragon family
board: Add Qualcomm Dragonboard 410C support
Add myself as Snapdragon and SPMI maintainer
MAINTAINERS | 11 +
arch/arm/Kconfig | 12 +
arch/arm/Makefile | 1 +
arch/arm/dts/Makefile | 2 +
arch/arm/dts/dragonboard410c-uboot.dtsi | 28 ++
arch/arm/dts/dragonboard410c.dts | 148 ++++++++++
arch/arm/mach-snapdragon/Kconfig | 26 ++
arch/arm/mach-snapdragon/Makefile | 8 +
arch/arm/mach-snapdragon/clock-apq8016.c | 262 ++++++++++++++++++
arch/arm/mach-snapdragon/include/mach/gpio.h | 9 +
.../mach-snapdragon/include/mach/sysmap-apq8016.h | 14 +
arch/arm/mach-snapdragon/reset.c | 40 +++
arch/sandbox/dts/sandbox.dts | 20 ++
arch/sandbox/dts/test.dts | 20 ++
board/qualcomm/dragonboard410c/Kconfig | 15 +
board/qualcomm/dragonboard410c/MAINTAINERS | 6 +
board/qualcomm/dragonboard410c/Makefile | 8 +
board/qualcomm/dragonboard410c/dragonboard410c.c | 131 +++++++++
board/qualcomm/dragonboard410c/head.S | 28 ++
board/qualcomm/dragonboard410c/readme.txt | 43 +++
board/qualcomm/dragonboard410c/u-boot.lds | 90 ++++++
configs/colibri_t20_defconfig | 2 +
configs/dragonboard410c_defconfig | 31 +++
configs/harmony_defconfig | 2 +
configs/mcx_defconfig | 3 +
configs/mt_ventoux_defconfig | 3 +
configs/sandbox_defconfig | 4 +
configs/twister_defconfig | 3 +
configs/zynq_picozed_defconfig | 3 +
configs/zynq_zc702_defconfig | 3 +
configs/zynq_zc706_defconfig | 3 +
configs/zynq_zed_defconfig | 3 +
configs/zynq_zybo_defconfig | 3 +
doc/device-tree-bindings/gpio/gpio-msm.txt | 22 ++
doc/device-tree-bindings/gpio/pm8916_gpio.txt | 48 ++++
doc/device-tree-bindings/mmc/msm_sdhci.txt | 25 ++
doc/device-tree-bindings/pmic/pm8916.txt | 18 ++
doc/device-tree-bindings/serial/msm-serial.txt | 6 +
doc/device-tree-bindings/spmi/spmi-msm.txt | 26 ++
doc/device-tree-bindings/spmi/spmi-sandbox.txt | 31 +++
doc/device-tree-bindings/usb/ehci-msm.txt | 10 +
doc/git-mailrc | 3 +
drivers/Kconfig | 2 +
drivers/Makefile | 1 +
drivers/gpio/Kconfig | 24 ++
drivers/gpio/Makefile | 2 +
drivers/gpio/msm_gpio.c | 135 +++++++++
drivers/gpio/pm8916_gpio.c | 302 +++++++++++++++++++++
drivers/mmc/Kconfig | 9 +
drivers/mmc/Makefile | 1 +
drivers/mmc/msm_sdhci.c | 180 ++++++++++++
drivers/power/pmic/Kconfig | 16 ++
drivers/power/pmic/Makefile | 1 +
drivers/power/pmic/pm8916.c | 96 +++++++
drivers/serial/Kconfig | 8 +
drivers/serial/Makefile | 1 +
drivers/serial/serial_msm.c | 212 +++++++++++++++
drivers/spmi/Kconfig | 23 ++
drivers/spmi/Makefile | 9 +
drivers/spmi/spmi-msm.c | 189 +++++++++++++
drivers/spmi/spmi-sandbox.c | 157 +++++++++++
drivers/spmi/spmi-uclass.c | 48 ++++
drivers/usb/Kconfig | 2 +
drivers/usb/host/Kconfig | 11 +
drivers/usb/host/Makefile | 1 +
drivers/usb/host/ehci-fsl.c | 2 +-
drivers/usb/host/ehci-hcd.c | 6 +
drivers/usb/host/ehci-mpc512x.c | 6 +-
drivers/usb/host/ehci-msm.c | 178 ++++++++++++
drivers/usb/host/ehci-mx5.c | 2 +-
drivers/usb/host/ehci-mx6.c | 2 +-
drivers/usb/host/ehci-mxc.c | 2 +-
drivers/usb/host/ehci-vf.c | 2 +-
drivers/usb/host/ehci-zynq.c | 2 +-
drivers/usb/host/ehci.h | 1 +
drivers/usb/ulpi/Kconfig | 33 +++
include/configs/colibri_t20.h | 2 -
include/configs/dragonboard410c.h | 153 +++++++++++
include/configs/harmony.h | 2 -
include/configs/mcx.h | 2 -
include/configs/tam3517-common.h | 2 -
include/configs/zynq-common.h | 2 -
include/dm/uclass-id.h | 1 +
include/spmi/spmi.h | 47 ++++
include/usb/{ehci-fsl.h => ehci-ci.h} | 16 +-
test/dm/Makefile | 1 +
test/dm/spmi.c | 115 ++++++++
87 files changed, 3156 insertions(+), 27 deletions(-)
create mode 100644 arch/arm/dts/dragonboard410c-uboot.dtsi
create mode 100644 arch/arm/dts/dragonboard410c.dts
create mode 100644 arch/arm/mach-snapdragon/Kconfig
create mode 100644 arch/arm/mach-snapdragon/Makefile
create mode 100644 arch/arm/mach-snapdragon/clock-apq8016.c
create mode 100644 arch/arm/mach-snapdragon/include/mach/gpio.h
create mode 100644 arch/arm/mach-snapdragon/include/mach/sysmap-apq8016.h
create mode 100644 arch/arm/mach-snapdragon/reset.c
create mode 100644 board/qualcomm/dragonboard410c/Kconfig
create mode 100644 board/qualcomm/dragonboard410c/MAINTAINERS
create mode 100644 board/qualcomm/dragonboard410c/Makefile
create mode 100644 board/qualcomm/dragonboard410c/dragonboard410c.c
create mode 100644 board/qualcomm/dragonboard410c/head.S
create mode 100644 board/qualcomm/dragonboard410c/readme.txt
create mode 100644 board/qualcomm/dragonboard410c/u-boot.lds
create mode 100644 configs/dragonboard410c_defconfig
create mode 100644 doc/device-tree-bindings/gpio/gpio-msm.txt
create mode 100644 doc/device-tree-bindings/gpio/pm8916_gpio.txt
create mode 100644 doc/device-tree-bindings/mmc/msm_sdhci.txt
create mode 100644 doc/device-tree-bindings/pmic/pm8916.txt
create mode 100644 doc/device-tree-bindings/serial/msm-serial.txt
create mode 100644 doc/device-tree-bindings/spmi/spmi-msm.txt
create mode 100644 doc/device-tree-bindings/spmi/spmi-sandbox.txt
create mode 100644 doc/device-tree-bindings/usb/ehci-msm.txt
create mode 100644 drivers/gpio/msm_gpio.c
create mode 100644 drivers/gpio/pm8916_gpio.c
create mode 100644 drivers/mmc/msm_sdhci.c
create mode 100644 drivers/power/pmic/pm8916.c
create mode 100644 drivers/serial/serial_msm.c
create mode 100644 drivers/spmi/Kconfig
create mode 100644 drivers/spmi/Makefile
create mode 100644 drivers/spmi/spmi-msm.c
create mode 100644 drivers/spmi/spmi-sandbox.c
create mode 100644 drivers/spmi/spmi-uclass.c
create mode 100644 drivers/usb/host/ehci-msm.c
create mode 100644 drivers/usb/ulpi/Kconfig
create mode 100644 include/configs/dragonboard410c.h
create mode 100644 include/spmi/spmi.h
rename include/usb/{ehci-fsl.h => ehci-ci.h} (96%)
create mode 100644 test/dm/spmi.c
--
2.5.0
6
37
Hi Simon,
Is there a way to make buildman compile sandbox with a non-system tool
chain? I've tried creating an alias from sandbox to i386 and removing
the "root" entry. It then simply claims not to have a sandbox tool
chain.
Thanks,
-Joe
3
6

13 Mar '16
Second round to add support for the GMAC Ethernet interface on RK3288
SoCs. I had hope to follow up a lot earlier, but things were bussier
then expected :(
To add support I've taken a slightly different approach then some of the
other boards with a designware IP block, by creating a new driver to
take care of the platfrom glue which subclasses the main designware driver
instead of adding the compatibility string the designware driver
directly and doing the SoC specific setup in the board files. This seems
quite a bit more elegant in a device model based world.
I've only tested this series on a Radxa Rock 2 board, it would be great
if someone could test this on other boards with the designware IP
especially for those with the reset GPIO in devicetree (e.g. some of the
Allwinner boards).
Compared to the first one round the pinctrl related bits were dropped as
RK3288 now has a full pinctrl driver. Furthermore the started hook in the
designware driver was renamed to fix_mac_speed in line with what linux
uses and moved to the dw_link_adjust function.
Changes in v2:
- Store probe gpio in private data not platdata
- Drop unneeded header file
- Move the hook into the dw_adjust_link function
- Rename the hook to fix_mac_speed, similar to Linux
- Fix various coding style nits
- Adjust to new hook name
Sjoerd Simons (12):
net: designware: support phy reset device-tree bindings
net: designware: Export various functions/struct to allow subclassing
net: designware: Add a fix_mac_speed hook
rockchip: rk3288: pinctrl: support more pins
rockchip: rk3288: Add clock support for the gmac ethernet interface
rockchip: rk3288: grf: Define GRF_SOC_CON1 and GRF_SOC_CON3
net: gmac_rk3288: Add RK3288 GMAC driver
rockchip: rk3288-firefly: Add gmac definition
rockchip: rock2: dts: use status = "okay" not ok
rockchip: Enable networking support on rock2 and firefly
rockchip: Add PXE and DHCP to the default boot targets
rockchip: Drop Ethernet from the TODO
arch/arm/dts/rk3288-firefly.dtsi | 16 +++
arch/arm/dts/rk3288-rock2-square.dts | 2 +-
arch/arm/include/asm/arch-rockchip/cru_rk3288.h | 17 ++++
arch/arm/include/asm/arch-rockchip/grf_rk3288.h | 53 ++++++++++
configs/firefly-rk3288_defconfig | 5 +
configs/rock2_defconfig | 5 +
doc/README.rockchip | 1 -
drivers/clk/clk_rk3288.c | 14 +++
drivers/net/Kconfig | 7 ++
drivers/net/Makefile | 1 +
drivers/net/designware.c | 90 ++++++++++++++---
drivers/net/designware.h | 18 ++++
drivers/net/gmac_rk3288.c | 125 ++++++++++++++++++++++++
drivers/pinctrl/rockchip/pinctrl_rk3288.c | 2 +-
include/configs/rk3288_common.h | 4 +-
15 files changed, 345 insertions(+), 15 deletions(-)
create mode 100644 drivers/net/gmac_rk3288.c
--
2.7.0
2
28

13 Mar '16
Globally enabled CONFIG_OF_TRANSLATE causes, that function dev_get_addr()
returns a different result for a node with: 'size-cells = <0>'.
The above change, breaks the Exynos boards for a long time, because of GPIO
driver, which uses the fdt in a non standard way.
After sending few approaches with adding support for that case,
the one was appllied for a temporary fix for the release:
"fdt: fix address cell count checking in fdt_translate_address()"
However, after discussion on the list, we found that this way can't be
accepted because the function __of_translate_address() as a backend
of dev_get_addr(), shouldn't be used for translating a non-MMIO addresses.
Updating some device tree files with '#size-cells = 1' and by extending
the 'reg' property by address length - fixes the problem.
This applies on u-boot-dm/master:
c5a7533 net: Fix delay in net_retry test
Przemyslaw Marczak (2):
dts:exynos:update pinctrl size-cells and fix child regs
Revert "fdt: fix address cell count checking in
fdt_translate_address()"
arch/arm/dts/exynos4210-pinctrl-uboot.dtsi | 8 ++++----
arch/arm/dts/exynos4x12-pinctrl-uboot.dtsi | 18 +++++++++---------
arch/arm/dts/exynos5250-pinctrl-uboot.dtsi | 16 ++++++++--------
arch/arm/dts/exynos54xx-pinctrl-uboot.dtsi | 12 ++++++------
arch/arm/dts/s5pc110-pinctrl.dtsi | 4 ++--
common/fdt_support.c | 7 ++++---
6 files changed, 33 insertions(+), 32 deletions(-)
--
1.9.1
3
7
The ICH GPIO driver does not work correctly at present. This series tidies
things up and fixes a few bugs.
One issue remaining is that reading from output GPIOs does not work - it
always returns 0.
Changes in v3:
- Correct failure logic in pci_get_bus()
- Use pci_get_bus in pci_bus_to_hose()
Changes in v2:
- Adjust pci_get_bus() to probe bus 0 so that the required bus is found
Simon Glass (4):
dm: pci: Allow a PCI bus to be found without an alias
gpio: Report errors when GPIOs cannot be read
WIP: x86: gpio: Handle the case where reading a GPIO fails
WIP: x86: gpio: Make sure that output GPIOs can be read
common/cmd_gpio.c | 34 +++++++++++++++++++++++++++-------
drivers/gpio/intel_ich6_gpio.c | 28 ++++++++++++++++++++++++++--
drivers/pci/pci-uclass.c | 28 ++++++++++++++++++++++++----
3 files changed, 77 insertions(+), 13 deletions(-)
--
2.5.0.457.gab17608
2
7