The current eva_ramboot.py script is currently only compatible with
Lantiq based AVM devices. For IPQ40xx devices, the offset needs to be
changed. Also an alignment is not necessary here.
Adjust the script to be able to pass an optional offset to load the
image to. In case no offset is provided, the script behaves exactly as
before this commit.
Signed-off-by: David Bauer <mail@david-bauer.net>
master
David Bauer6 years agocommitted byChristian Lamparter
parser=argparse.ArgumentParser(description='Tool to boot AVM EVA ramdisk images.')
parser.add_argument('ip',type=str,help='IP-address to transfer the image to')
parser.add_argument('image',type=str,help='Location of the ramdisk image')
parser.add_argument('--offset',type=lambdax:int(x,0),help='Offset to load the image to in hex format with leading 0x. Only needed for non-lantiq devices.')
args=parser.parse_args()
size=stat(image).st_size
size=stat(args.image).st_size
# arbitrary size limit, to prevent the address calculations from overflows etc.
assertsize<0x2000000
# We need to align the address. A page boundary seems to be sufficient on 7362sl
# and 7412
addr=((0x8000000-size)&~0xfff)
haddr=0x80000000+addr
img=open(image,"rb")
ifargs.offset:
addr=size
haddr=args.offset
else:
# We need to align the address.
# A page boundary seems to be sufficient on 7362sl and 7412