This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] AM62L: Printing Addresses while booting in Linux

Part Number: AM62L


I want to be able to print the MMC 2 Addresses before and after a code block to check what are the changes that have been made by that code block.

What is the process to do this?

  • Steps for printing the address while booting

    1. Download the Processor SDK for AM61L.
    2. Flash the image to the USB
    3. Change the boot mode to SD boot mode:
      1. 11000010 01000000 (8-15)
    4. Boot AM62L with SD mode
    5. Find the location for the code block, say the below code block changes in the initialization needs to be seen:
      1. API: 'mmc_send_io_op_cond'
      2. Location: 'ti-processor-sdk-linux-am62lxx-evm-11.00.15.05/board-support/ti-linux-kernel-6.12.24+git-ti/drivers/mmc/core/sdio_ops.c'
    6. Similarly, any other code block can be taken to find the values of the required registers.
    7. It is important to note here that the registers we input are the physical registers and we need to map them to their respective virtual addresses.
    8. Add the Below code where required:
      1. void __iomem *reg_1;
         
        reg_1 = ioremap(0xFA2000E, 4); // address of register to read and register size
        pr_info("Printing the value at required address: %08x\n", readb(reg_1));
        iounmap(reg_1);
    9.  Once the code is added correctly, the Processor SDK needs to be rebuilt and reflashed.
    10. If the SD card is present in the AM62L:
      1. Reboot the board and stop in U-Boot
      2. type in the command: 
        1. ums 0 mmc 1
        2. Verify that this command is working by seeing the boot and root folders being shown on your PC
      3. To build the Processor SDK, run
        1. make -sj<n> linux
      4.  Next, to flash to the SDK, run the code below with the respective changes in the DESTDIR and BOOTFS
        1. sudo DESTDIR=/media/yashraj/root BOOTFS=/media/yashraj/boot make linux_install 
      5. Make sure the flashing is completed by running:
        1. sync
      6. Once above steps are done, eject the SD card from Files folder
      7. Now, in U-Boot terminal, run
        1. reset
      8. This boots with the updated changes
    11. Now, the register address values will be printed in the terminal along with other boot print statements.

    These can then be viewed using the

    dmesg
    command after booting.