mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
Merge git://git.denx.de/u-boot-dm
This commit is contained in:
@@ -206,6 +206,16 @@ int gpio_requestf(unsigned gpio, const char *fmt, ...)
|
||||
|
||||
struct fdtdec_phandle_args;
|
||||
|
||||
/**
|
||||
* gpio_xlate_offs_flags() - implementation for common use of dm_gpio_ops.xlate
|
||||
*
|
||||
* This routine sets the offset field to args[0] and the flags field to
|
||||
* GPIOD_ACTIVE_LOW if the GPIO_ACTIVE_LOW flag is present in args[1].
|
||||
*
|
||||
*/
|
||||
int gpio_xlate_offs_flags(struct udevice *dev, struct gpio_desc *desc,
|
||||
struct fdtdec_phandle_args *args);
|
||||
|
||||
/**
|
||||
* struct struct dm_gpio_ops - Driver model GPIO operations
|
||||
*
|
||||
@@ -258,12 +268,11 @@ struct dm_gpio_ops {
|
||||
*
|
||||
* @desc->dev to @dev
|
||||
* @desc->flags to 0
|
||||
* @desc->offset to the value of the first argument in args, if any,
|
||||
* otherwise -1 (which is invalid)
|
||||
* @desc->offset to 0
|
||||
*
|
||||
* This method is optional so if the above defaults suit it can be
|
||||
* omitted. Typical behaviour is to set up the GPIOD_ACTIVE_LOW flag
|
||||
* in desc->flags.
|
||||
* This method is optional and defaults to gpio_xlate_offs_flags,
|
||||
* which will parse offset and the GPIO_ACTIVE_LOW flag in the first
|
||||
* two arguments.
|
||||
*
|
||||
* Note that @dev is passed in as a parameter to follow driver model
|
||||
* uclass conventions, even though it is already available as
|
||||
|
||||
263
include/blk.h
263
include/blk.h
@@ -30,6 +30,7 @@ enum if_type {
|
||||
IF_TYPE_SD,
|
||||
IF_TYPE_SATA,
|
||||
IF_TYPE_HOST,
|
||||
IF_TYPE_SYSTEMACE,
|
||||
|
||||
IF_TYPE_COUNT, /* Number of interface types */
|
||||
};
|
||||
@@ -62,6 +63,11 @@ struct blk_desc {
|
||||
char product[20+1]; /* IDE Serial no, SCSI product */
|
||||
char revision[8+1]; /* firmware revision */
|
||||
#ifdef CONFIG_BLK
|
||||
/*
|
||||
* For now we have a few functions which take struct blk_desc as a
|
||||
* parameter. This field allows them to look up the associated
|
||||
* device. Once these functions are removed we can drop this field.
|
||||
*/
|
||||
struct udevice *bdev;
|
||||
#else
|
||||
unsigned long (*block_read)(struct blk_desc *block_dev,
|
||||
@@ -210,6 +216,25 @@ struct blk_ops {
|
||||
*/
|
||||
unsigned long (*erase)(struct udevice *dev, lbaint_t start,
|
||||
lbaint_t blkcnt);
|
||||
|
||||
/**
|
||||
* select_hwpart() - select a particular hardware partition
|
||||
*
|
||||
* Some devices (e.g. MMC) can support partitioning at the hardware
|
||||
* level. This is quite separate from the normal idea of
|
||||
* software-based partitions. MMC hardware partitions must be
|
||||
* explicitly selected. Once selected only the region of the device
|
||||
* covered by that partition is accessible.
|
||||
*
|
||||
* The MMC standard provides for two boot partitions (numbered 1 and 2),
|
||||
* rpmb (3), and up to 4 addition general-purpose partitions (4-7).
|
||||
*
|
||||
* @desc: Block device to update
|
||||
* @hwpart: Hardware partition number to select. 0 means the raw
|
||||
* device, 1 is the first partition, 2 is the second, etc.
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int (*select_hwpart)(struct udevice *dev, int hwpart);
|
||||
};
|
||||
|
||||
#define blk_get_ops(dev) ((struct blk_ops *)(dev)->driver->ops)
|
||||
@@ -269,7 +294,8 @@ int blk_next_device(struct udevice **devp);
|
||||
* @drv_name: Driver name to use for the block device
|
||||
* @name: Name for the device
|
||||
* @if_type: Interface type (enum if_type_t)
|
||||
* @devnum: Device number, specific to the interface type
|
||||
* @devnum: Device number, specific to the interface type, or -1 to
|
||||
* allocate the next available number
|
||||
* @blksz: Block size of the device in bytes (typically 512)
|
||||
* @size: Total size of the device in bytes
|
||||
* @devp: the new device (which has not been probed)
|
||||
@@ -278,6 +304,23 @@ int blk_create_device(struct udevice *parent, const char *drv_name,
|
||||
const char *name, int if_type, int devnum, int blksz,
|
||||
lbaint_t size, struct udevice **devp);
|
||||
|
||||
/**
|
||||
* blk_create_devicef() - Create a new named block device
|
||||
*
|
||||
* @parent: Parent of the new device
|
||||
* @drv_name: Driver name to use for the block device
|
||||
* @name: Name for the device (parent name is prepended)
|
||||
* @if_type: Interface type (enum if_type_t)
|
||||
* @devnum: Device number, specific to the interface type, or -1 to
|
||||
* allocate the next available number
|
||||
* @blksz: Block size of the device in bytes (typically 512)
|
||||
* @size: Total size of the device in bytes
|
||||
* @devp: the new device (which has not been probed)
|
||||
*/
|
||||
int blk_create_devicef(struct udevice *parent, const char *drv_name,
|
||||
const char *name, int if_type, int devnum, int blksz,
|
||||
lbaint_t size, struct udevice **devp);
|
||||
|
||||
/**
|
||||
* blk_prepare_device() - Prepare a block device for use
|
||||
*
|
||||
@@ -298,6 +341,29 @@ int blk_prepare_device(struct udevice *dev);
|
||||
*/
|
||||
int blk_unbind_all(int if_type);
|
||||
|
||||
/**
|
||||
* blk_find_max_devnum() - find the maximum device number for an interface type
|
||||
*
|
||||
* Finds the last allocated device number for an interface type @if_type. The
|
||||
* next number is safe to use for a newly allocated device.
|
||||
*
|
||||
* @if_type: Interface type to scan
|
||||
* @return maximum device number found, or -ENODEV if none, or other -ve on
|
||||
* error
|
||||
*/
|
||||
int blk_find_max_devnum(enum if_type if_type);
|
||||
|
||||
/**
|
||||
* blk_select_hwpart() - select a hardware partition
|
||||
*
|
||||
* Select a hardware partition if the device supports it (typically MMC does)
|
||||
*
|
||||
* @dev: Device to update
|
||||
* @hwpart: Partition number to select
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int blk_select_hwpart(struct udevice *dev, int hwpart);
|
||||
|
||||
#else
|
||||
#include <errno.h>
|
||||
/*
|
||||
@@ -340,6 +406,201 @@ static inline ulong blk_derase(struct blk_desc *block_dev, lbaint_t start,
|
||||
blkcache_invalidate(block_dev->if_type, block_dev->devnum);
|
||||
return block_dev->block_erase(block_dev, start, blkcnt);
|
||||
}
|
||||
|
||||
/**
|
||||
* struct blk_driver - Driver for block interface types
|
||||
*
|
||||
* This provides access to the block devices for each interface type. One
|
||||
* driver should be provided using U_BOOT_LEGACY_BLK() for each interface
|
||||
* type that is to be supported.
|
||||
*
|
||||
* @if_typename: Interface type name
|
||||
* @if_type: Interface type
|
||||
* @max_devs: Maximum number of devices supported
|
||||
* @desc: Pointer to list of devices for this interface type,
|
||||
* or NULL to use @get_dev() instead
|
||||
*/
|
||||
struct blk_driver {
|
||||
const char *if_typename;
|
||||
enum if_type if_type;
|
||||
int max_devs;
|
||||
struct blk_desc *desc;
|
||||
/**
|
||||
* get_dev() - get a pointer to a block device given its number
|
||||
*
|
||||
* Each interface allocates its own devices and typically
|
||||
* struct blk_desc is contained with the interface's data structure.
|
||||
* There is no global numbering for block devices. This method allows
|
||||
* the device for an interface type to be obtained when @desc is NULL.
|
||||
*
|
||||
* @devnum: Device number (0 for first device on that interface,
|
||||
* 1 for second, etc.
|
||||
* @descp: Returns pointer to the block device on success
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int (*get_dev)(int devnum, struct blk_desc **descp);
|
||||
|
||||
/**
|
||||
* select_hwpart() - Select a hardware partition
|
||||
*
|
||||
* Some devices (e.g. MMC) can support partitioning at the hardware
|
||||
* level. This is quite separate from the normal idea of
|
||||
* software-based partitions. MMC hardware partitions must be
|
||||
* explicitly selected. Once selected only the region of the device
|
||||
* covered by that partition is accessible.
|
||||
*
|
||||
* The MMC standard provides for two boot partitions (numbered 1 and 2),
|
||||
* rpmb (3), and up to 4 addition general-purpose partitions (4-7).
|
||||
* Partition 0 is the main user-data partition.
|
||||
*
|
||||
* @desc: Block device descriptor
|
||||
* @hwpart: Hardware partition number to select. 0 means the main
|
||||
* user-data partition, 1 is the first partition, 2 is
|
||||
* the second, etc.
|
||||
* @return 0 if OK, other value for an error
|
||||
*/
|
||||
int (*select_hwpart)(struct blk_desc *desc, int hwpart);
|
||||
};
|
||||
|
||||
/*
|
||||
* Declare a new U-Boot legacy block driver. New drivers should use driver
|
||||
* model (UCLASS_BLK).
|
||||
*/
|
||||
#define U_BOOT_LEGACY_BLK(__name) \
|
||||
ll_entry_declare(struct blk_driver, __name, blk_driver)
|
||||
|
||||
struct blk_driver *blk_driver_lookup_type(int if_type);
|
||||
|
||||
#endif /* !CONFIG_BLK */
|
||||
|
||||
/**
|
||||
* blk_get_devnum_by_typename() - Get a block device by type and number
|
||||
*
|
||||
* This looks through the available block devices of the given type, returning
|
||||
* the one with the given @devnum.
|
||||
*
|
||||
* @if_type: Block device type
|
||||
* @devnum: Device number
|
||||
* @return point to block device descriptor, or NULL if not found
|
||||
*/
|
||||
struct blk_desc *blk_get_devnum_by_type(enum if_type if_type, int devnum);
|
||||
|
||||
/**
|
||||
* blk_get_devnum_by_type() - Get a block device by type name, and number
|
||||
*
|
||||
* This looks up the block device type based on @if_typename, then calls
|
||||
* blk_get_devnum_by_type().
|
||||
*
|
||||
* @if_typename: Block device type name
|
||||
* @devnum: Device number
|
||||
* @return point to block device descriptor, or NULL if not found
|
||||
*/
|
||||
struct blk_desc *blk_get_devnum_by_typename(const char *if_typename,
|
||||
int devnum);
|
||||
|
||||
/**
|
||||
* blk_dselect_hwpart() - select a hardware partition
|
||||
*
|
||||
* This selects a hardware partition (such as is supported by MMC). The block
|
||||
* device size may change as this effectively points the block device to a
|
||||
* partition at the hardware level. See the select_hwpart() method above.
|
||||
*
|
||||
* @desc: Block device descriptor for the device to select
|
||||
* @hwpart: Partition number to select
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int blk_dselect_hwpart(struct blk_desc *desc, int hwpart);
|
||||
|
||||
/**
|
||||
* blk_list_part() - list the partitions for block devices of a given type
|
||||
*
|
||||
* This looks up the partition type for each block device of type @if_type,
|
||||
* then displays a list of partitions.
|
||||
*
|
||||
* @if_type: Block device type
|
||||
* @return 0 if OK, -ENODEV if there is none of that type
|
||||
*/
|
||||
int blk_list_part(enum if_type if_type);
|
||||
|
||||
/**
|
||||
* blk_list_devices() - list the block devices of a given type
|
||||
*
|
||||
* This lists each block device of the type @if_type, showing the capacity
|
||||
* as well as type-specific information.
|
||||
*
|
||||
* @if_type: Block device type
|
||||
*/
|
||||
void blk_list_devices(enum if_type if_type);
|
||||
|
||||
/**
|
||||
* blk_show_device() - show information about a given block device
|
||||
*
|
||||
* This shows the block device capacity as well as type-specific information.
|
||||
*
|
||||
* @if_type: Block device type
|
||||
* @devnum: Device number
|
||||
* @return 0 if OK, -ENODEV for invalid device number
|
||||
*/
|
||||
int blk_show_device(enum if_type if_type, int devnum);
|
||||
|
||||
/**
|
||||
* blk_print_device_num() - show information about a given block device
|
||||
*
|
||||
* This is similar to blk_show_device() but returns an error if the block
|
||||
* device type is unknown.
|
||||
*
|
||||
* @if_type: Block device type
|
||||
* @devnum: Device number
|
||||
* @return 0 if OK, -ENODEV for invalid device number, -ENOENT if the block
|
||||
* device is not connected
|
||||
*/
|
||||
int blk_print_device_num(enum if_type if_type, int devnum);
|
||||
|
||||
/**
|
||||
* blk_print_part_devnum() - print the partition information for a device
|
||||
*
|
||||
* @if_type: Block device type
|
||||
* @devnum: Device number
|
||||
* @return 0 if OK, -ENOENT if the block device is not connected, -ENOSYS if
|
||||
* the interface type is not supported, other -ve on other error
|
||||
*/
|
||||
int blk_print_part_devnum(enum if_type if_type, int devnum);
|
||||
|
||||
/**
|
||||
* blk_read_devnum() - read blocks from a device
|
||||
*
|
||||
* @if_type: Block device type
|
||||
* @devnum: Device number
|
||||
* @blkcnt: Number of blocks to read
|
||||
* @buffer: Address to write data to
|
||||
* @return number of blocks read, or -ve error number on error
|
||||
*/
|
||||
ulong blk_read_devnum(enum if_type if_type, int devnum, lbaint_t start,
|
||||
lbaint_t blkcnt, void *buffer);
|
||||
|
||||
/**
|
||||
* blk_write_devnum() - write blocks to a device
|
||||
*
|
||||
* @if_type: Block device type
|
||||
* @devnum: Device number
|
||||
* @blkcnt: Number of blocks to write
|
||||
* @buffer: Address to read data from
|
||||
* @return number of blocks written, or -ve error number on error
|
||||
*/
|
||||
ulong blk_write_devnum(enum if_type if_type, int devnum, lbaint_t start,
|
||||
lbaint_t blkcnt, const void *buffer);
|
||||
|
||||
/**
|
||||
* blk_select_hwpart_devnum() - select a hardware partition
|
||||
*
|
||||
* This is similar to blk_dselect_hwpart() but it looks up the interface and
|
||||
* device number.
|
||||
*
|
||||
* @if_type: Block device type
|
||||
* @devnum: Device number
|
||||
* @hwpart: Partition number to select
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int blk_select_hwpart_devnum(enum if_type if_type, int devnum, int hwpart);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
#define CONFIG_CMD_READ /* Read data from partition */
|
||||
#define CONFIG_CMD_SANDBOX /* sb command to access sandbox features */
|
||||
#define CONFIG_CMD_SAVES /* save S record dump */
|
||||
#define CONFIG_CMD_SCSI /* SCSI Support */
|
||||
#define CONFIG_SCSI /* SCSI Support */
|
||||
#define CONFIG_CMD_SDRAM /* SDRAM DIMM SPD info printout */
|
||||
#define CONFIG_CMD_TERMINAL /* built-in Serial Terminal */
|
||||
#define CONFIG_CMD_UBI /* UBI Support */
|
||||
|
||||
@@ -165,7 +165,7 @@
|
||||
BOOT_TARGET_DEVICES_references_SATA_without_CONFIG_CMD_SATA
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_SCSI
|
||||
#ifdef CONFIG_SCSI
|
||||
#define BOOTENV_RUN_SCSI_INIT "run scsi_init; "
|
||||
#define BOOTENV_SET_SCSI_NEED_INIT "setenv scsi_need_init; "
|
||||
#define BOOTENV_SHARED_SCSI \
|
||||
@@ -185,9 +185,9 @@
|
||||
#define BOOTENV_SET_SCSI_NEED_INIT
|
||||
#define BOOTENV_SHARED_SCSI
|
||||
#define BOOTENV_DEV_SCSI \
|
||||
BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI
|
||||
BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_SCSI
|
||||
#define BOOTENV_DEV_NAME_SCSI \
|
||||
BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_CMD_SCSI
|
||||
BOOT_TARGET_DEVICES_references_SCSI_without_CONFIG_SCSI
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CMD_IDE
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
/* Rather than repeat this expression each time, add a define for it */
|
||||
#if defined(CONFIG_CMD_IDE) || \
|
||||
defined(CONFIG_CMD_SATA) || \
|
||||
defined(CONFIG_CMD_SCSI) || \
|
||||
defined(CONFIG_SCSI) || \
|
||||
defined(CONFIG_CMD_USB) || \
|
||||
defined(CONFIG_CMD_PART) || \
|
||||
defined(CONFIG_CMD_GPT) || \
|
||||
|
||||
@@ -373,7 +373,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
#define CONFIG_CMD_PCI
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -576,7 +576,7 @@
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
#define CONFIG_CMD_PCI
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
||||
@@ -449,7 +449,7 @@
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
#define CONFIG_CMD_PCI
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#endif
|
||||
|
||||
#define CONFIG_WATCHDOG /* watchdog enabled */
|
||||
|
||||
@@ -354,8 +354,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
|
||||
|
||||
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
|
||||
|
||||
#undef CONFIG_SYS_SCSI_SCAN_BUS_REVERSE
|
||||
|
||||
#define CONFIG_PCI_PNP /* do pci plug-and-play */
|
||||
|
||||
#undef CONFIG_EEPRO100
|
||||
@@ -612,7 +610,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
|
||||
|
||||
#if defined(CONFIG_PCI)
|
||||
#define CONFIG_CMD_PCI
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#endif
|
||||
|
||||
#undef CONFIG_WATCHDOG /* watchdog disabled */
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define CONFIG_CMD_EEPROM
|
||||
#define CONFIG_CMD_REGINFO
|
||||
#define CONFIG_CMD_FDC
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_CMD_DATE
|
||||
#define CONFIG_CMD_SDRAM
|
||||
#define CONFIG_CMD_SAVES
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
|
||||
/* SATA */
|
||||
#define CONFIG_BOARD_LATE_INIT
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_LIBATA
|
||||
#define CONFIG_SCSI_AHCI
|
||||
#define CONFIG_SCSI_AHCI_PLAT
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
#define CONFIG_SPL_SATA_BOOT_DEVICE 0
|
||||
#define CONFIG_SYS_SATA_FAT_BOOT_PARTITION 1
|
||||
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_LIBATA
|
||||
#define CONFIG_SCSI_AHCI
|
||||
#define CONFIG_SCSI_AHCI_PLAT
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#define CONFIG_SYS_NO_FLASH /* Declare no flash (NOR/SPI) */
|
||||
#define CONFIG_CMD_ENV
|
||||
#define CONFIG_CMD_PCI
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
|
||||
/* I2C */
|
||||
#define CONFIG_SYS_I2C
|
||||
|
||||
@@ -230,7 +230,7 @@
|
||||
|
||||
/* SATA */
|
||||
#define CONFIG_BOARD_LATE_INIT
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_LIBATA
|
||||
#define CONFIG_SCSI_AHCI
|
||||
#define CONFIG_SCSI_AHCI_PLAT
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#undef CONFIG_VIDEO
|
||||
#undef CONFIG_CFB_CONSOLE
|
||||
#undef CONFIG_SCSI_AHCI
|
||||
#undef CONFIG_CMD_SCSI
|
||||
#undef CONFIG_SCSI
|
||||
#undef CONFIG_INTEL_ICH6_GPIO
|
||||
#undef CONFIG_USB_EHCI_PCI
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
/* SATA is not supported in Quark SoC */
|
||||
#undef CONFIG_SCSI_AHCI
|
||||
#undef CONFIG_CMD_SCSI
|
||||
#undef CONFIG_SCSI
|
||||
|
||||
/* Video is not supported in Quark SoC */
|
||||
#undef CONFIG_VIDEO
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
/*
|
||||
* Command line configuration.
|
||||
*/
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
|
||||
#define CONFIG_BOOT_RETRY_TIME -1
|
||||
#define CONFIG_RESET_TO_RETRY
|
||||
|
||||
@@ -108,7 +108,7 @@ unsigned long get_board_ddr_clk(void);
|
||||
#define CONFIG_LIBATA
|
||||
#define CONFIG_SCSI_AHCI
|
||||
#define CONFIG_SCSI_AHCI_PLAT
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_DOS_PARTITION
|
||||
#define CONFIG_BOARD_LATE_INIT
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ unsigned long get_board_ddr_clk(void);
|
||||
#define CONFIG_LIBATA
|
||||
#define CONFIG_SCSI_AHCI
|
||||
#define CONFIG_SCSI_AHCI_PLAT
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_DOS_PARTITION
|
||||
#define CONFIG_BOARD_LATE_INIT
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ unsigned long get_board_sys_clk(void);
|
||||
#define CONFIG_LIBATA
|
||||
#define CONFIG_SCSI_AHCI
|
||||
#define CONFIG_SCSI_AHCI_PLAT
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_DOS_PARTITION
|
||||
#define CONFIG_BOARD_LATE_INIT
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
/* Max time to hold reset on this board, see doc/README.omap-reset-time */
|
||||
#define CONFIG_OMAP_PLATFORM_RESET_TIME_MAX_USEC 16296
|
||||
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_LIBATA
|
||||
#define CONFIG_SCSI_AHCI
|
||||
#define CONFIG_SCSI_AHCI_PLAT
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
#define CONFIG_ATAPI
|
||||
|
||||
#undef CONFIG_SCSI_AHCI
|
||||
#undef CONFIG_CMD_SCSI
|
||||
#undef CONFIG_SCSI
|
||||
#else
|
||||
#define CONFIG_SCSI_DEV_LIST \
|
||||
{PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_ICH9_AHCI}
|
||||
|
||||
@@ -192,4 +192,29 @@
|
||||
#define CONFIG_CMD_LZMADEC
|
||||
#define CONFIG_CMD_DATE
|
||||
|
||||
#define CONFIG_CMD_IDE
|
||||
#define CONFIG_SYS_IDE_MAXBUS 1
|
||||
#define CONFIG_SYS_ATA_IDE0_OFFSET 0
|
||||
#define CONFIG_SYS_IDE_MAXDEVICE 2
|
||||
#define CONFIG_SYS_ATA_BASE_ADDR 0x100
|
||||
#define CONFIG_SYS_ATA_DATA_OFFSET 0
|
||||
#define CONFIG_SYS_ATA_REG_OFFSET 1
|
||||
#define CONFIG_SYS_ATA_ALT_OFFSET 2
|
||||
#define CONFIG_SYS_ATA_STRIDE 4
|
||||
|
||||
#define CONFIG_SCSI
|
||||
#define CONFIG_SCSI_AHCI_PLAT
|
||||
#define CONFIG_SYS_SCSI_MAX_DEVICE 2
|
||||
#define CONFIG_SYS_SCSI_MAX_SCSI_ID 8
|
||||
#define CONFIG_SYS_SCSI_MAX_LUN 4
|
||||
|
||||
#define CONFIG_CMD_SATA
|
||||
#define CONFIG_SYS_SATA_MAX_DEVICE 2
|
||||
|
||||
#define CONFIG_SYSTEMACE
|
||||
#define CONFIG_SYS_SYSTEMACE_WIDTH 16
|
||||
#define CONFIG_SYS_SYSTEMACE_BASE 0
|
||||
|
||||
#define CONFIG_GENERIC_MMC
|
||||
|
||||
#endif
|
||||
|
||||
@@ -297,8 +297,6 @@
|
||||
|
||||
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
|
||||
|
||||
#undef CONFIG_SYS_SCSI_SCAN_BUS_REVERSE
|
||||
|
||||
#define CONFIG_PCI_PNP /* do pci plug-and-play */
|
||||
|
||||
#undef CONFIG_EEPRO100
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
#define CONFIG_SYS_SCSI_MAX_LUN 1
|
||||
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
|
||||
CONFIG_SYS_SCSI_MAX_LUN)
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#endif
|
||||
|
||||
#define CONFIG_SETUP_MEMORY_TAGS
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
#define CONFIG_CMD_IRQ
|
||||
#define CONFIG_CMD_PCI
|
||||
#define CONFIG_CMD_GETTIME
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
|
||||
#define CONFIG_CMD_ZBOOT
|
||||
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
#define CONFIG_SYS_SCSI_MAX_LUN 1
|
||||
#define CONFIG_SYS_SCSI_MAX_DEVICE (CONFIG_SYS_SCSI_MAX_SCSI_ID * \
|
||||
CONFIG_SYS_SCSI_MAX_LUN)
|
||||
#define CONFIG_CMD_SCSI
|
||||
#define CONFIG_SCSI
|
||||
#endif
|
||||
|
||||
#define CONFIG_SYS_BOOTM_LEN (60 * 1024 * 1024)
|
||||
|
||||
@@ -41,6 +41,9 @@ struct driver_info;
|
||||
/* Device is bound */
|
||||
#define DM_FLAG_BOUND (1 << 6)
|
||||
|
||||
/* Device name is allocated and should be freed on unbind() */
|
||||
#define DM_NAME_ALLOCED (1 << 7)
|
||||
|
||||
/**
|
||||
* struct udevice - An instance of a driver
|
||||
*
|
||||
@@ -523,6 +526,9 @@ bool device_is_last_sibling(struct udevice *dev);
|
||||
* this is unnecessary but for probed devices which don't get a useful name
|
||||
* this function can be helpful.
|
||||
*
|
||||
* The name is allocated and will be freed automatically when the device is
|
||||
* unbound.
|
||||
*
|
||||
* @dev: Device to update
|
||||
* @name: New name (this string is allocated new memory and attached to
|
||||
* the device)
|
||||
@@ -531,6 +537,16 @@ bool device_is_last_sibling(struct udevice *dev);
|
||||
*/
|
||||
int device_set_name(struct udevice *dev, const char *name);
|
||||
|
||||
/**
|
||||
* device_set_name_alloced() - note that a device name is allocated
|
||||
*
|
||||
* This sets the DM_NAME_ALLOCED flag for the device, so that when it is
|
||||
* unbound the name will be freed. This avoids memory leaks.
|
||||
*
|
||||
* @dev: Device to update
|
||||
*/
|
||||
void device_set_name_alloced(struct udevice *dev);
|
||||
|
||||
/**
|
||||
* device_is_on_pci_bus - Test if a device is on a PCI bus
|
||||
*
|
||||
|
||||
23
include/dm/platform_data/serial_coldfire.h
Normal file
23
include/dm/platform_data/serial_coldfire.h
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Angelo Dureghello <angelo@sysam.it>
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifndef __serial_coldfire_h
|
||||
#define __serial_coldfire_h
|
||||
|
||||
/*
|
||||
* struct coldfire_serial_platdata - information about a coldfire port
|
||||
*
|
||||
* @base: Uart port base register address
|
||||
* @port: Uart port index, for cpu with pinmux for uart / gpio
|
||||
* baudrtatre: Uart port baudrate
|
||||
*/
|
||||
struct coldfire_serial_platdata {
|
||||
unsigned long base;
|
||||
int port;
|
||||
int baudrate;
|
||||
};
|
||||
|
||||
#endif /* __serial_coldfire_h */
|
||||
@@ -26,11 +26,11 @@ enum uclass_id {
|
||||
|
||||
/* U-Boot uclasses start here - in alphabetical order */
|
||||
UCLASS_ADC, /* Analog-to-digital converter */
|
||||
UCLASS_AHCI, /* SATA disk controller */
|
||||
UCLASS_BLK, /* Block device */
|
||||
UCLASS_CLK, /* Clock source, e.g. used by peripherals */
|
||||
UCLASS_CPU, /* CPU, typically part of an SoC */
|
||||
UCLASS_CROS_EC, /* Chrome OS EC */
|
||||
UCLASS_DISK, /* Disk controller, e.g. SATA */
|
||||
UCLASS_DISPLAY, /* Display (e.g. DisplayPort, HDMI) */
|
||||
UCLASS_DMA, /* Direct Memory Access */
|
||||
UCLASS_RAM, /* RAM controller */
|
||||
|
||||
@@ -34,10 +34,18 @@ void ide_led(uchar led, uchar status);
|
||||
|
||||
void ide_init(void);
|
||||
struct blk_desc;
|
||||
struct udevice;
|
||||
#ifdef CONFIG_BLK
|
||||
ulong ide_read(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
void *buffer);
|
||||
ulong ide_write(struct udevice *dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
const void *buffer);
|
||||
#else
|
||||
ulong ide_read(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
void *buffer);
|
||||
ulong ide_write(struct blk_desc *block_dev, lbaint_t blknr, lbaint_t blkcnt,
|
||||
const void *buffer);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IDE_PREINIT
|
||||
int ide_preinit(void);
|
||||
|
||||
@@ -31,10 +31,11 @@
|
||||
#define writew(val, addr) iotrace_writew(val, (const void *)(addr))
|
||||
|
||||
#undef readb
|
||||
#define readb(addr) iotrace_readb((const void *)(addr))
|
||||
#define readb(addr) iotrace_readb((const void *)(uintptr_t)addr)
|
||||
|
||||
#undef writeb
|
||||
#define writeb(val, addr) iotrace_writeb(val, (const void *)(addr))
|
||||
#define writeb(val, addr) \
|
||||
iotrace_writeb(val, (const void *)(uintptr_t)addr)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -17,4 +17,13 @@ enum usb_dr_mode {
|
||||
USB_DR_MODE_OTG,
|
||||
};
|
||||
|
||||
/**
|
||||
* usb_get_dr_mode() - Get dual role mode for given device
|
||||
* @node: Node offset to the given device
|
||||
*
|
||||
* The function gets phy interface string from property 'dr_mode',
|
||||
* and returns the correspondig enum usb_dr_mode
|
||||
*/
|
||||
enum usb_dr_mode usb_get_dr_mode(int node);
|
||||
|
||||
#endif /* __LINUX_USB_OTG_H */
|
||||
|
||||
@@ -344,7 +344,9 @@ struct mmc_config {
|
||||
|
||||
/* TODO struct mmc should be in mmc_private but it's hard to fix right now */
|
||||
struct mmc {
|
||||
#ifndef CONFIG_BLK
|
||||
struct list_head link;
|
||||
#endif
|
||||
const struct mmc_config *cfg; /* provided configuration */
|
||||
uint version;
|
||||
void *priv;
|
||||
@@ -376,11 +378,16 @@ struct mmc {
|
||||
u64 capacity_gp[4];
|
||||
u64 enh_user_start;
|
||||
u64 enh_user_size;
|
||||
#ifndef CONFIG_BLK
|
||||
struct blk_desc block_dev;
|
||||
#endif
|
||||
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 */
|
||||
int ddr_mode;
|
||||
#ifdef CONFIG_DM_MMC
|
||||
struct udevice *dev; /* Device for this MMC controller */
|
||||
#endif
|
||||
};
|
||||
|
||||
struct mmc_hwpart_conf {
|
||||
@@ -406,7 +413,29 @@ enum mmc_hwpart_conf_mode {
|
||||
|
||||
int mmc_register(struct mmc *mmc);
|
||||
struct mmc *mmc_create(const struct mmc_config *cfg, void *priv);
|
||||
|
||||
/**
|
||||
* mmc_bind() - Set up a new MMC device ready for probing
|
||||
*
|
||||
* A child block device is bound with the IF_TYPE_MMC interface type. This
|
||||
* allows the device to be used with CONFIG_BLK
|
||||
*
|
||||
* @dev: MMC device to set up
|
||||
* @mmc: MMC struct
|
||||
* @cfg: MMC configuration
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int mmc_bind(struct udevice *dev, struct mmc *mmc,
|
||||
const struct mmc_config *cfg);
|
||||
void mmc_destroy(struct mmc *mmc);
|
||||
|
||||
/**
|
||||
* mmc_unbind() - Unbind a MMC device's child block device
|
||||
*
|
||||
* @dev: MMC device
|
||||
* @return 0 if OK, -ve on error
|
||||
*/
|
||||
int mmc_unbind(struct udevice *dev);
|
||||
int mmc_initialize(bd_t *bis);
|
||||
int mmc_init(struct mmc *mmc);
|
||||
int mmc_read(struct mmc *mmc, u64 src, uchar *dst, int size);
|
||||
@@ -415,7 +444,6 @@ struct mmc *find_mmc_device(int dev_num);
|
||||
int mmc_set_dev(int dev_num);
|
||||
void print_mmc_devices(char separator);
|
||||
int get_mmc_num(void);
|
||||
int mmc_switch_part(int dev_num, unsigned int part_num);
|
||||
int mmc_hwpart_config(struct mmc *mmc, const struct mmc_hwpart_conf *conf,
|
||||
enum mmc_hwpart_conf_mode mode);
|
||||
int mmc_getcd(struct mmc *mmc);
|
||||
@@ -498,4 +526,12 @@ int pci_mmc_init(const char *name, struct pci_device_id *mmc_supported);
|
||||
#define CONFIG_SYS_MMC_MAX_BLK_COUNT 65535
|
||||
#endif
|
||||
|
||||
/**
|
||||
* mmc_get_blk_desc() - Get the block descriptor for an MMC device
|
||||
*
|
||||
* @mmc: MMC device
|
||||
* @return block device if found, else NULL
|
||||
*/
|
||||
struct blk_desc *mmc_get_blk_desc(struct mmc *mmc);
|
||||
|
||||
#endif /* _MMC_H_ */
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
struct block_drvr {
|
||||
char *name;
|
||||
struct blk_desc* (*get_dev)(int dev);
|
||||
int (*select_hwpart)(int dev_num, int hwpart);
|
||||
};
|
||||
|
||||
@@ -73,32 +72,8 @@ typedef struct disk_partition {
|
||||
* error occurred.
|
||||
*/
|
||||
struct blk_desc *blk_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);
|
||||
|
||||
/**
|
||||
* mmc_select_hwpart() - Select the MMC hardware partiion on an MMC device
|
||||
*
|
||||
* MMC devices can support partitioning at the hardware level. This is quite
|
||||
* separate from the normal idea of software-based partitions. MMC hardware
|
||||
* partitions must be explicitly selected. Once selected only the region of
|
||||
* the device covered by that partition is accessible.
|
||||
*
|
||||
* The MMC standard provides for two boot partitions (numbered 1 and 2),
|
||||
* rpmb (3), and up to 4 addition general-purpose partitions (4-7).
|
||||
*
|
||||
* @dev_num: Block device number (struct blk_desc->dev value)
|
||||
* @hwpart: Hardware partition number to select. 0 means the raw device,
|
||||
* 1 is the first partition, 2 is the second, etc.
|
||||
* @return 0 if OK, other value for an error
|
||||
*/
|
||||
int mmc_select_hwpart(int dev_num, int hwpart);
|
||||
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 */
|
||||
@@ -175,15 +150,7 @@ extern const struct block_drvr block_drvr[];
|
||||
#else
|
||||
static inline struct blk_desc *blk_get_dev(const char *ifname, 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 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 part_get_info(struct blk_desc *dev_desc, int part,
|
||||
disk_partition_t *info) { return -1; }
|
||||
|
||||
@@ -612,6 +612,58 @@ int sandbox_spi_get_emul(struct sandbox_state *state,
|
||||
struct udevice *bus, struct udevice *slave,
|
||||
struct udevice **emulp);
|
||||
|
||||
/**
|
||||
* Claim the bus and prepare it for communication with a given slave.
|
||||
*
|
||||
* This must be called before doing any transfers with a SPI slave. It
|
||||
* will enable and initialize any SPI hardware as necessary, and make
|
||||
* sure that the SCK line is in the correct idle state. It is not
|
||||
* allowed to claim the same bus for several slaves without releasing
|
||||
* the bus in between.
|
||||
*
|
||||
* @dev: The SPI slave device
|
||||
*
|
||||
* Returns: 0 if the bus was claimed successfully, or a negative value
|
||||
* if it wasn't.
|
||||
*/
|
||||
int dm_spi_claim_bus(struct udevice *dev);
|
||||
|
||||
/**
|
||||
* Release the SPI bus
|
||||
*
|
||||
* This must be called once for every call to dm_spi_claim_bus() after
|
||||
* all transfers have finished. It may disable any SPI hardware as
|
||||
* appropriate.
|
||||
*
|
||||
* @slave: The SPI slave device
|
||||
*/
|
||||
void dm_spi_release_bus(struct udevice *dev);
|
||||
|
||||
/**
|
||||
* SPI transfer
|
||||
*
|
||||
* This writes "bitlen" bits out the SPI MOSI port and simultaneously clocks
|
||||
* "bitlen" bits in the SPI MISO port. That's just the way SPI works.
|
||||
*
|
||||
* The source of the outgoing bits is the "dout" parameter and the
|
||||
* destination of the input bits is the "din" parameter. Note that "dout"
|
||||
* and "din" can point to the same memory location, in which case the
|
||||
* input data overwrites the output data (since both are buffered by
|
||||
* temporary variables, this is OK).
|
||||
*
|
||||
* dm_spi_xfer() interface:
|
||||
* @dev: The SPI slave device which will be sending/receiving the data.
|
||||
* @bitlen: How many bits to write and read.
|
||||
* @dout: Pointer to a string of bits to send out. The bits are
|
||||
* held in a byte array and are sent MSB first.
|
||||
* @din: Pointer to a string of bits that will be filled in.
|
||||
* @flags: A bitwise combination of SPI_XFER_* flags.
|
||||
*
|
||||
* Returns: 0 on success, not 0 on failure
|
||||
*/
|
||||
int dm_spi_xfer(struct udevice *dev, unsigned int bitlen,
|
||||
const void *dout, void *din, unsigned long flags);
|
||||
|
||||
/* Access the operations for a SPI device */
|
||||
#define spi_get_ops(dev) ((struct dm_spi_ops *)(dev)->driver->ops)
|
||||
#define spi_emul_get_ops(dev) ((struct dm_spi_emul_ops *)(dev)->driver->ops)
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef __SYSTEMACE_H
|
||||
#define __SYSTEMACE_H
|
||||
/*
|
||||
* Copyright (c) 2004 Picture Elements, Inc.
|
||||
* Stephen Williams (steve@picturel.com)
|
||||
*
|
||||
* SPDX-License-Identifier: GPL-2.0+
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_SYSTEMACE
|
||||
|
||||
# include <part.h>
|
||||
|
||||
struct blk_desc *systemace_get_dev(int dev);
|
||||
|
||||
#endif /* CONFIG_SYSTEMACE */
|
||||
#endif /* __SYSTEMACE_H */
|
||||
@@ -228,7 +228,6 @@ int board_usb_cleanup(int index, enum usb_init_type init);
|
||||
#ifdef CONFIG_USB_STORAGE
|
||||
|
||||
#define USB_MAX_STOR_DEV 7
|
||||
struct blk_desc *usb_stor_get_dev(int index);
|
||||
int usb_stor_scan(int mode);
|
||||
int usb_stor_info(void);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user