This does not work correctly without either a sync or a 'sleep 1'. I think sync is better. Without this the board does not boot, presumably because of these error in the log: [35534.897215] Buffer I/O error on dev sdd, logical block 8, lost async page write [35534.897216] Buffer I/O error on dev sdd, logical block 9, lost async page write [35534.897742] sd 8:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [35534.897743] sd 8:0:0:0: [sdd] tag#0 Sense Key : Not Ready [current] [35534.897744] sd 8:0:0:0: [sdd] tag#0 Add. Sense: Medium not present [35534.897745] sd 8:0:0:0: [sdd] tag#0 CDB: Write(10) 2a 00 00 00 00 f0 00 00 f0 00 [35534.897745] print_req_error: I/O error, dev sdd, sector 240 [35534.898262] sd 8:0:0:0: [sdd] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE [35534.898263] sd 8:0:0:0: [sdd] tag#0 Sense Key : Not Ready [current] [35534.898264] sd 8:0:0:0: [sdd] tag#0 Add. Sense: Medium not present [35534.898264] sd 8:0:0:0: [sdd] tag#0 CDB: Write(10) 2a 00 00 00 01 e0 00 00 f0 00 After that the card is non-functionality until physically replugged. Signed-off-by: Simon Glass <sjg@chromium.org> Signed-off-by: Stephen Warren <swarren@nvidia.com>
37 lines
1.4 KiB
Plaintext
Executable File
37 lines
1.4 KiB
Plaintext
Executable File
# Copyright 2019 Google LLC. All rights reserved.
|
|
#
|
|
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
# copy of this software and associated documentation files (the "Software"),
|
|
# to deal in the Software without restriction, including without limitation
|
|
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
# and/or sell copies of the Software, and to permit persons to whom the
|
|
# Software is furnished to do so, subject to the following conditions:
|
|
#
|
|
# The above copyright notice and this permission notice shall be included in
|
|
# all copies or substantial portions of the Software.
|
|
#
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
# DEALINGS IN THE SOFTWARE.
|
|
|
|
# Writes sunxi image to the board
|
|
|
|
# Args:
|
|
# $1: Device path of the sdcard when board is off (e.g. /dev/sdcard0)
|
|
# $2: U-Boot build directory
|
|
|
|
set -ex
|
|
|
|
device=$1
|
|
build=$2
|
|
|
|
echo "Writing to ${device} from build at ${build}"
|
|
|
|
dd if=/dev/zero of=$device bs=1k count=1024
|
|
dd if=${build}/u-boot-sunxi-with-spl.bin of=$device bs=1024 seek=8
|
|
sync $device
|