aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMagnus Damm <damm+renesas@opensource.se>2015-01-26 01:19:51 -0500
committerSimon Horman <horms+renesas@verge.net.au>2015-02-23 16:45:25 -0500
commitc6535e1e0361157ea073b57b626d0611b7c4c7a0 (patch)
tree487f7731c53f692664e7b1dbc2b344c61c2f6476
parentedf41009060442258ed3090fc782835c4f9f831f (diff)
Documentation: Remove ZBOOT MMC/SDHI utility and docs
Remove ZBOOT MMC/SDHI Documentation for sh7372 together wit the vrl4 utility. Without sh7372 and Mackerel support these files are no longer useful. Signed-off-by: Magnus Damm <damm+renesas@opensource.se> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--Documentation/Makefile2
-rw-r--r--Documentation/arm/Makefile1
-rw-r--r--Documentation/arm/SH-Mobile/Makefile7
-rw-r--r--Documentation/arm/SH-Mobile/vrl4.c170
-rw-r--r--Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt29
-rw-r--r--Documentation/arm/SH-Mobile/zboot-rom-sdhi.txt42
6 files changed, 1 insertions, 250 deletions
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 6883a1b9b351..bc0548201755 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -1,4 +1,4 @@
1subdir-y := accounting arm auxdisplay blackfin connector \ 1subdir-y := accounting auxdisplay blackfin connector \
2 filesystems filesystems ia64 laptops mic misc-devices \ 2 filesystems filesystems ia64 laptops mic misc-devices \
3 networking pcmcia prctl ptp spi timers vDSO video4linux \ 3 networking pcmcia prctl ptp spi timers vDSO video4linux \
4 watchdog 4 watchdog
diff --git a/Documentation/arm/Makefile b/Documentation/arm/Makefile
deleted file mode 100644
index 732c77050cff..000000000000
--- a/Documentation/arm/Makefile
+++ /dev/null
@@ -1 +0,0 @@
1subdir-y := SH-Mobile
diff --git a/Documentation/arm/SH-Mobile/Makefile b/Documentation/arm/SH-Mobile/Makefile
deleted file mode 100644
index bca8a7ef6bbe..000000000000
--- a/Documentation/arm/SH-Mobile/Makefile
+++ /dev/null
@@ -1,7 +0,0 @@
1# List of programs to build
2hostprogs-y := vrl4
3
4# Tell kbuild to always build the programs
5always := $(hostprogs-y)
6
7HOSTCFLAGS_vrl4.o += -I$(objtree)/usr/include -I$(srctree)/tools/include
diff --git a/Documentation/arm/SH-Mobile/vrl4.c b/Documentation/arm/SH-Mobile/vrl4.c
deleted file mode 100644
index f4cd8ad4e720..000000000000
--- a/Documentation/arm/SH-Mobile/vrl4.c
+++ /dev/null
@@ -1,170 +0,0 @@
1/*
2 * vrl4 format generator
3 *
4 * Copyright (C) 2010 Simon Horman
5 *
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
9 */
10
11/*
12 * usage: vrl4 < zImage > out
13 * dd if=out of=/dev/sdx bs=512 seek=1 # Write the image to sector 1
14 *
15 * Reads a zImage from stdin and writes a vrl4 image to stdout.
16 * In practice this means writing a padded vrl4 header to stdout followed
17 * by the zImage.
18 *
19 * The padding places the zImage at ALIGN bytes into the output.
20 * The vrl4 uses ALIGN + START_BASE as the start_address.
21 * This is where the mask ROM will jump to after verifying the header.
22 *
23 * The header sets copy_size to min(sizeof(zImage), MAX_BOOT_PROG_LEN) + ALIGN.
24 * That is, the mask ROM will load the padded header (ALIGN bytes)
25 * And then MAX_BOOT_PROG_LEN bytes of the image, or the entire image,
26 * whichever is smaller.
27 *
28 * The zImage is not modified in any way.
29 */
30
31#define _BSD_SOURCE
32#include <endian.h>
33#include <unistd.h>
34#include <stdint.h>
35#include <stdio.h>
36#include <errno.h>
37#include <tools/endian.h>
38
39struct hdr {
40 uint32_t magic1;
41 uint32_t reserved1;
42 uint32_t magic2;
43 uint32_t reserved2;
44 uint16_t copy_size;
45 uint16_t boot_options;
46 uint32_t reserved3;
47 uint32_t start_address;
48 uint32_t reserved4;
49 uint32_t reserved5;
50 char reserved6[308];
51};
52
53#define DECLARE_HDR(h) \
54 struct hdr (h) = { \
55 .magic1 = htole32(0xea000000), \
56 .reserved1 = htole32(0x56), \
57 .magic2 = htole32(0xe59ff008), \
58 .reserved3 = htole16(0x1) }
59
60/* Align to 512 bytes, the MMCIF sector size */
61#define ALIGN_BITS 9
62#define ALIGN (1 << ALIGN_BITS)
63
64#define START_BASE 0xe55b0000
65
66/*
67 * With an alignment of 512 the header uses the first sector.
68 * There is a 128 sector (64kbyte) limit on the data loaded by the mask ROM.
69 * So there are 127 sectors left for the boot programme. But in practice
70 * Only a small portion of a zImage is needed, 16 sectors should be more
71 * than enough.
72 *
73 * Note that this sets how much of the zImage is copied by the mask ROM.
74 * The entire zImage is present after the header and is loaded
75 * by the code in the boot program (which is the first portion of the zImage).
76 */
77#define MAX_BOOT_PROG_LEN (16 * 512)
78
79#define ROUND_UP(x) ((x + ALIGN - 1) & ~(ALIGN - 1))
80
81static ssize_t do_read(int fd, void *buf, size_t count)
82{
83 size_t offset = 0;
84 ssize_t l;
85
86 while (offset < count) {
87 l = read(fd, buf + offset, count - offset);
88 if (!l)
89 break;
90 if (l < 0) {
91 if (errno == EAGAIN || errno == EWOULDBLOCK)
92 continue;
93 perror("read");
94 return -1;
95 }
96 offset += l;
97 }
98
99 return offset;
100}
101
102static ssize_t do_write(int fd, const void *buf, size_t count)
103{
104 size_t offset = 0;
105 ssize_t l;
106
107 while (offset < count) {
108 l = write(fd, buf + offset, count - offset);
109 if (l < 0) {
110 if (errno == EAGAIN || errno == EWOULDBLOCK)
111 continue;
112 perror("write");
113 return -1;
114 }
115 offset += l;
116 }
117
118 return offset;
119}
120
121static ssize_t write_zero(int fd, size_t len)
122{
123 size_t i = len;
124
125 while (i--) {
126 const char x = 0;
127 if (do_write(fd, &x, 1) < 0)
128 return -1;
129 }
130
131 return len;
132}
133
134int main(void)
135{
136 DECLARE_HDR(hdr);
137 char boot_program[MAX_BOOT_PROG_LEN];
138 size_t aligned_hdr_len, alligned_prog_len;
139 ssize_t prog_len;
140
141 prog_len = do_read(0, boot_program, sizeof(boot_program));
142 if (prog_len <= 0)
143 return -1;
144
145 aligned_hdr_len = ROUND_UP(sizeof(hdr));
146 hdr.start_address = htole32(START_BASE + aligned_hdr_len);
147 alligned_prog_len = ROUND_UP(prog_len);
148 hdr.copy_size = htole16(aligned_hdr_len + alligned_prog_len);
149
150 if (do_write(1, &hdr, sizeof(hdr)) < 0)
151 return -1;
152 if (write_zero(1, aligned_hdr_len - sizeof(hdr)) < 0)
153 return -1;
154
155 if (do_write(1, boot_program, prog_len) < 0)
156 return 1;
157
158 /* Write out the rest of the kernel */
159 while (1) {
160 prog_len = do_read(0, boot_program, sizeof(boot_program));
161 if (prog_len < 0)
162 return 1;
163 if (prog_len == 0)
164 break;
165 if (do_write(1, boot_program, prog_len) < 0)
166 return 1;
167 }
168
169 return 0;
170}
diff --git a/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt b/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt
deleted file mode 100644
index efff8ae2713d..000000000000
--- a/Documentation/arm/SH-Mobile/zboot-rom-mmcif.txt
+++ /dev/null
@@ -1,29 +0,0 @@
1ROM-able zImage boot from MMC
2-----------------------------
3
4An ROM-able zImage compiled with ZBOOT_ROM_MMCIF may be written to MMC and
5SuperH Mobile ARM will to boot directly from the MMCIF hardware block.
6
7This is achieved by the mask ROM loading the first portion of the image into
8MERAM and then jumping to it. This portion contains loader code which
9copies the entire image to SDRAM and jumps to it. From there the zImage
10boot code proceeds as normal, uncompressing the image into its final
11location and then jumping to it.
12
13This code has been tested on an AP4EB board using the developer 1A eMMC
14boot mode which is configured using the following jumper settings.
15The board used for testing required a patched mask ROM in order for
16this mode to function.
17
18 8 7 6 5 4 3 2 1
19 x|x|x|x|x| |x|
20S4 -+-+-+-+-+-+-+-
21 | | | | |x| |x on
22
23The zImage must be written to the MMC card at sector 1 (512 bytes) in
24vrl4 format. A utility vrl4 is supplied to accomplish this.
25
26e.g.
27 vrl4 < zImage | dd of=/dev/sdX bs=512 seek=1
28
29A dual-voltage MMC 4.0 card was used for testing.
diff --git a/Documentation/arm/SH-Mobile/zboot-rom-sdhi.txt b/Documentation/arm/SH-Mobile/zboot-rom-sdhi.txt
deleted file mode 100644
index 441959846e1a..000000000000
--- a/Documentation/arm/SH-Mobile/zboot-rom-sdhi.txt
+++ /dev/null
@@ -1,42 +0,0 @@
1ROM-able zImage boot from eSD
2-----------------------------
3
4An ROM-able zImage compiled with ZBOOT_ROM_SDHI may be written to eSD and
5SuperH Mobile ARM will to boot directly from the SDHI hardware block.
6
7This is achieved by the mask ROM loading the first portion of the image into
8MERAM and then jumping to it. This portion contains loader code which
9copies the entire image to SDRAM and jumps to it. From there the zImage
10boot code proceeds as normal, uncompressing the image into its final
11location and then jumping to it.
12
13This code has been tested on an mackerel board using the developer 1A eSD
14boot mode which is configured using the following jumper settings.
15
16 8 7 6 5 4 3 2 1
17 x|x|x|x| |x|x|
18S4 -+-+-+-+-+-+-+-
19 | | | |x| | |x on
20
21The eSD card needs to be present in SDHI slot 1 (CN7).
22As such S1 and S33 also need to be configured as per
23the notes in arch/arm/mach-shmobile/board-mackerel.c.
24
25A partial zImage must be written to physical partition #1 (boot)
26of the eSD at sector 0 in vrl4 format. A utility vrl4 is supplied to
27accomplish this.
28
29e.g.
30 vrl4 < zImage | dd of=/dev/sdX bs=512 count=17
31
32A full copy of _the same_ zImage should be written to physical partition #1
33(boot) of the eSD at sector 0. This should _not_ be in vrl4 format.
34
35 vrl4 < zImage | dd of=/dev/sdX bs=512
36
37Note: The commands above assume that the physical partition has been
38switched. No such facility currently exists in the Linux Kernel.
39
40Physical partitions are described in the eSD specification. At the time of
41writing they are not the same as partitions that are typically configured
42using fdisk and visible through /proc/partitions