From 66eef1e780caf0bb3ecadf78582a29031c6279ce Mon Sep 17 00:00:00 2001 From: Nathan Rossi Date: Tue, 17 Nov 2015 22:56:56 +1000 Subject: tools: zynqimage: Add Xilinx Zynq boot header generation to mkimage As with other platforms vendors love to create their own boot header formats. Xilinx is no different and for the Zynq platform/SoC there exists the "boot.bin" which is read by the platforms bootrom. This format is described to a useful extent within the Xilinx Zynq TRM. This implementation adds support for the 'zynqimage' to mkimage. The implementation only considers the most common boot header which is un-encrypted and packed directly after the boot header itself (no XIP, etc.). However this implementation does take into consideration the other fields of the header for image dumping use cases (vector table and register initialization). Signed-off-by: Nathan Rossi Cc: Michal Simek Cc: Tom Rini Reviewed-by: Tom Rini Signed-off-by: Michal Simek --- common/image.c | 1 + 1 file changed, 1 insertion(+) (limited to 'common') diff --git a/common/image.c b/common/image.c index 85c4f39cdf..c36927fca8 100644 --- a/common/image.c +++ b/common/image.c @@ -158,6 +158,7 @@ static const table_entry_t uimage_type[] = { { IH_TYPE_RKIMAGE, "rkimage", "Rockchip Boot Image" }, { IH_TYPE_RKSD, "rksd", "Rockchip SD Boot Image" }, { IH_TYPE_RKSPI, "rkspi", "Rockchip SPI Boot Image" }, + { IH_TYPE_ZYNQIMAGE, "zynqimage", "Xilinx Zynq Boot Image" }, { -1, "", "", }, }; -- cgit v1.2.1 From bdaeb8f23c6d5d11829072baaf0c0fe37c09f26a Mon Sep 17 00:00:00 2001 From: Michal Simek Date: Mon, 19 Oct 2015 15:13:34 +0200 Subject: common: mii: Do not allow to exceed max phy limit Phy can have addresses 0-31. Check this boundary to ensure that user can't call commands on phy address 32 and more. Signed-off-by: Michal Simek Reviewed-by: Tom Rini --- common/cmd_mii.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'common') diff --git a/common/cmd_mii.c b/common/cmd_mii.c index 5e9079da04..7ef7532a50 100644 --- a/common/cmd_mii.c +++ b/common/cmd_mii.c @@ -314,6 +314,11 @@ static int do_mii(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) mask = simple_strtoul(argv[5], NULL, 16); } + if (addrhi > 31) { + printf("Incorrect PHY address. Range should be 0-31\n"); + return CMD_RET_USAGE; + } + /* use current device */ devname = miiphy_get_current_dev(); -- cgit v1.2.1