I am currently using uboot to boot linux kernel. I have not mentioned ttyS0 or anything in the console parameter. I get to see the output only when there is not console parameter while if I specify the console parameter the log stops after "Starting Kernel...". So I was trying to find if the linux kernel uses the u-boot serial driver to print and get characters. But when I make a small change or add a print statement in the driver I can see that change till the u-boot command line while I cannot see these when Linux is started. I am wondering which driver is being used to print data and get data from the console.
Edit(1) : After some working with the TTY Driver I am now getting print statements on console. See log below :
[ 0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x84000000
[ 0.000000] Linux version 5.5.0-rc1-00032-g264b43306b8c-dirty (venkatakrishnan@venkatakrishnan-ubuntu) (gcc version 10.2.0 (GCC)) #22 Tue Jul 27 15:02:20 IST 2021
[ 0.000000] initrd not found or empty - disabling initrd
[ 0.000000] Zone ranges:
[ 0.000000] DMA32 [mem 0x0000000084000000-0x000000008fffffff]
[ 0.000000] Normal empty
[ 0.000000] Movable zone start for each node
[ 0.000000] Early memory node ranges
[ 0.000000] node 0: [mem 0x0000000084000000-0x000000008fffffff]
[ 0.000000] Initmem setup node 0 [mem 0x0000000084000000-0x000000008fffffff]
[ 0.000000] software IO TLB: mapped [mem 0x8bd5b000-0x8fd5b000] (64MB)
[ 0.000000] elf_hwcap is 0x1105
[ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 48480
[ 0.000000] Kernel command line: console=ttySHAKTI0,19200n8 earlycon root=/dev/mmcblk1p1 rw rootfs=ext4 noinitrd selinux=0
[ 0.000000] Dentry cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[ 0.000000] Inode-cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[ 0.000000] Sorting __ex_table...
[ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[ 0.000000] Memory: 112684K/196608K available (3868K kernel code, 199K rwdata, 702K rodata, 9856K init, 233K bss, 83924K reserved, 0K cma-reserved)
[ 0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[ 0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[ 0.000000] plic: mapped 29 interrupts with 1 handlers for 2 contexts.
[ 0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[ 0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x1ef4687b1, max_idle_ns: 112843571739654 ns
[ 0.001342] sched_clock: 64 bits at 32kHz, resolution 30517ns, wraps every 70368744171142ns
[ 0.011474] Calibrating delay loop (skipped), value calculated using timer frequency.. 0.06 BogoMIPS (lpj=131)
[ 0.016326] pid_max: default: 32768 minimum: 301
[ 0.077301] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.082397] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[ 0.482940] devtmpfs: initialized
[ 1.069976] random: get_random_bytes called from setup_net+0x54/0x1dc with crng_init=0
[ 1.123840] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[ 1.129333] futex hash table entries: 256 (order: 0, 6144 bytes, linear)
[ 1.213317] NET: Registered protocol family 16
[ 1.639770] Shakti UART Probing started...
[ 1.669952] 11300.uart: ttySHAKTI0 at MMIO 0x11300 (irq = 0, base_baud = 0) is a Shakti UART 0
[ 234.333038] printk: console [ttySHAKTI0] enabled
[ 235.845855] clocksource: Switched to clocksource riscv_clocksource
[ 236.541534] NET: Registered protocol family 2
[ 236.840209] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[ 237.152709] TCP established hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 237.442626] TCP bind hash table entries: 2048 (order: 2, 16384 bytes, linear)
[ 237.703186] TCP: Hash tables configured (established 2048 bind 2048)
[ 237.953887] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 238.188140] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[ 238.492340] NET: Registered protocol family 1
[ 268.344238] workingset: timestamp_bits=62 max_order=15 bucket_order=0
[ 281.773803] ntfs: driver 2.1.32 [Flags: R/W DEBUG].
[ 282.271209] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 253)
[ 282.536315] io scheduler mq-deadline registered
[ 282.675445] io scheduler kyber registered
[ 282.983062] io scheduler bfq registered
[ 304.778137] Error: Driver 'shakti-uart' is already registered, aborting...
[ 305.379852] shakti_spi 20100.spi: Shakti SPI Driver initialized
[ 306.020507] libphy: Fixed MDIO Bus: probed
[ 306.185424] xilinx_emaclite 44000.ethernet: Device Tree Probing
[ 306.439025] libphy: Xilinx Emaclite MDIO: probed
[ 306.686065] xilinx_emaclite 44000.ethernet: MAC address is now 00:0a:35:00:00:00
[ 307.191101] xilinx_emaclite 44000.ethernet: Xilinx EmacLite at 0x00044000 mapped to 0x04010000, irq=29
[ 307.796661] mmc_spi spi0.0: SD/MMC host mmc0, no DMA, no WP, no poweroff, cd polling
[ 308.229644] NET: Registered protocol family 17
[ 311.828765] Freeing unused kernel memory: 9856K
[ 311.968719] This architecture does not have kernel memory protection.
[ 312.218292] Run /init as init process
[ 313.042419] mmc0: host does not support reading read-only switch, assuming write-enable
[ 313.339843] mmc0: new SDHC card on SPI
[ 314.152679] mmcblk0: mmc0:0000 SS08G 7.40 GiB
[ 315.783752] mmcblk0: p1
I am still wondering that I am not able to see the login prompt and I can see this console being used as log console where the printk statements are only printed(similar to dmesg command). Also for input do we need to register interrupts and use that to being data in or is there any polling method possible?