
Code: Select all
#include "bcm2708-rpi-b-plus.dts"
&i2c1 {
status = "okay";
pcf8563: pcf8563@51 {
compatible = "nxp,pcf8563";
reg = <0x51>;
status = "okay";
};
};



Code: Select all
ARMMEM_END = MEM_SIZE - GPU_MEM
// Leave 64KB for GRUB
free_end = ALIGN_DOWN(ARMMEM_END - 0x10000, 0x1000)
// Leave space for initramfs, if there is one
free_end = ALIGN_DOWN(free_end - initramfs_size, 0x1000)
device_tree_address = ALIGN_DOWN(free_end - device_tree_size, 0x100)

That's presumably a configuration quirk specific to the Pi Foundation's kernel, and is not true for mainline Linux?PhilE wrote:That would be true on a system with a 1/3 kernel/user split, but we use a 2/2 split so it's all low mem.
You need one of the USB to R Pi pin-to-serial devices. The PI pin voltage swing is too low for a serial port.TheDJVG wrote:Has anyone found a way to view the u-boot output and kernel boot output over pins 14/15? I'm able to start u-boot without any problems but I can't see the kernel booting process over serial.
I've tried merging the device tree files (bcm2710-rpi-3-b.dts and pi3-disable-bt-overlay.dts) and started the kernel with "console=serial0 or serial1 or ttyAMA0 or ttyS0" but no luck. I might be doing something wrong but I don't know what.
PhilE wrote:The DTB start address is size dependent. The aim is to copy the DTB as high as possible. Once the kernel starts it will "unflatten" the DTB into allocated memory and then re-use the space.
1
ARM memory starts at 0 in the VPU physical address space. The GPU memory sits at the top. This is how it works:
Don't forget that the address of the DTB is passed in register r2 to the kernel/U-boot entry point, with r0 holding 0 and r1 being 3138 (the BCM2708 machine id).Code: Select all
ARMMEM_END = MEM_SIZE - GPU_MEM // Leave 64KB for GRUB free_end = ALIGN_DOWN(ARMMEM_END - 0x10000, 0x1000) // Leave space for initramfs, if there is one free_end = ALIGN_DOWN(free_end - initramfs_size, 0x1000) device_tree_address = ALIGN_DOWN(free_end - device_tree_size, 0x100)

Code: Select all
struct boot_param_header {
u32 magic; /* magic word 0xd00dfeed */
u32 totalsize; /* total size of DT block */
u32 off_dt_struct; /* offset to structure */
u32 off_dt_strings; /* offset to strings */
u32 off_mem_rsvmap; /* offset to memory reserve map
*/
u32 version; /* format version */
u32 last_comp_version; /* last compatible version */
/* version 2 fields below */
u32 boot_cpuid_phys; /* Which physical CPU id we're
booting on */
/* version 3 fields below */
u32 size_dt_strings; /* size of the strings block */
/* version 17 fields below */
u32 size_dt_struct; /* size of the DT structure block */
};
Can you post the definitions of the structures referenced in this header, or a github (or similar) repository?PhilE wrote:The Flattened Device Tree format, which is what is generated by dtc and stored in DTB files and overlays, starts with a header including the length:i.e. you just need to check the magic, then read the second word to get the length.Code: Select all
struct boot_param_header { u32 magic; /* magic word 0xd00dfeed */ u32 totalsize; /* total size of DT block */ u32 off_dt_struct; /* offset to structure */ u32 off_dt_strings; /* offset to strings */ u32 off_mem_rsvmap; /* offset to memory reserve map */ u32 version; /* format version */ u32 last_comp_version; /* last compatible version */ /* version 2 fields below */ u32 boot_cpuid_phys; /* Which physical CPU id we're booting on */ /* version 3 fields below */ u32 size_dt_strings; /* size of the strings block */ /* version 17 fields below */ u32 size_dt_struct; /* size of the DT structure block */ };
Code: Select all
fatload mmc 0:1 ${kernel_addr_r} kernel7.img
fatload mmc 0:1 ${fdt_addr_r} bcm2710-rpi-3-b.dtb
setenv bootargs earlyprintk dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rootwait
bootz ${kernel_addr_r} - ${fdt_addr_r}
Code: Select all
mkimage -A arm -O linux -T script -C none -a 0x00000000 -e 0x00000000 -n "rpi3 boot script" -d boot.txt boot.scr
Code: Select all
fatload mmc 0:1 ${kernel_addr_r} kernel7.img
setenv bootargs earlyprintk dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rootwait
bootz ${kernel_addr_r} - ${fdt_addr}
Thanks @PhilE and @swarren for your replies. However, I tried your script and not to load bcm2710-rpi-3-b.dtb in boot.scr but when Uboot starts, still the dtoverlays are not detected. In /u-boot/include/configs/rpi.h --> the fdt_addr_r is set to 0x100. I am confused, could it be memory overlap?. I am trying to inspect U-boot just it would be useful as many applications can use it.swarren wrote:@ahmedawad,
For example, your boot script might be (untested):
Reference: http://git.denx.de/?p=u-boot.git;a=blob ... aster#l257Code: Select all
fatload mmc 0:1 ${kernel_addr_r} kernel7.img setenv bootargs earlyprintk dwc_otg.lpm_enable=0 console=serial0,115200 root=/dev/mmcblk0p3 rootfstype=ext4 rootwait bootz ${kernel_addr_r} - ${fdt_addr}

Users browsing this forum: No registered users and 1 guest