xref: /freebsd/contrib/file/magic/Magdir/rpi (revision 3e5d0784b9b5296bda801add034b057ad68237f7)
1
2#------------------------------------------------------------------------------
3# $File: rpi,v 1.3 2022/04/02 14:39:34 christos Exp $
4# rpi:  file(1) magic for Raspberry Pi images
5-44		lelong	0
6>4		lelong	0
7>>8		lelong	1
8>>12		lelong	4
9>>>16		string	283x
10>>>>20		lelong	1
11>>>>>24		lelong	4
12>>>>>>28	string	DTOK
13>>>>>>>32	lelong	44
14>>>>>>>>36	lelong	4
15>>>>>>>>>40	string	RPTL		Raspberry PI kernel image
16
17-56		lelong	0
18>4		lelong	0
19>>8		lelong	1
20>>12		lelong	4
21>>>16		string	283x
22>>>>20		lelong	1
23>>>>>24		lelong	4
24>>>>>>28	string	DTOK
25>>>>>>>32	lelong	1
26>>>>>>>>36	lelong	4
27>>>>>>>>>40	string	DDTK8
28>>>>>>>>>>48	lelong	4
29>>>>>>>>>>>52	string	RPTL		Raspberry PI kernel image
30
31# From: 	Joerg Jenderek
32# URL:		https://www.raspberrypi.com/documentation/computers/raspberry-pi.html
33#		#raspberry-pi-4-boot-eeprom
34# Reference:	https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-config
35# Note:		start with same magic as for BIOS (ia32) ROM Extension handled by ./intel
36# masked with MAGIC_MASK and then compared with MAGIC
370	belong&0xFFffF00F	0x55aaF00F	Raspberry PI EEPROM
38#!:mime	application/octet-stream
39!:mime	application/x-raspberry-eeprom
40# like: pieeprom-2020-09-03.bin
41!:ext	bin
42# a 32 bit offset to the next section like: 000184d4 000184c8 00018534 ... 0000bb84 0000bbd4 0000bbd4
43>4	ubelong			x		\b, offset %8.8x
44#>(4.L)	ubelong			x		NEXT=%8.8x
45# self.length
46>8	ubelong			!0		\b, length %x
47# self.filename
48>12	string			>0		\b, "%s"
49# length is zero
50>8	ubelong			=0
51# if length is zero then 2nd section magic here can be zero; this means sections parsing done
52>>8	ubelong			!0		\b, 2nd MAGIC=%8.8x
53