How to enable frame buffer console #52

Open
opened 2024-09-22 23:25:55 -04:00 by NathanChiu95 · 4 comments
NathanChiu95 commented 2024-09-22 23:25:55 -04:00 (Migrated from github.com)

Hi, I would like to show the boot logs on the mipi LCD with frame buffer console, but I cannot get it working.

I hv added the following in
build\boards\sg200x\sg2002_licheervnano_sd\linux\sg2002_licheervnano_sd_defconfig:

CONFIG_FB=y
# CONFIG_FB_CVITEK=m ## This is origional
CONFIG_FB_CVITEK=y
# CONFIG_FRAMEBUFFER_CONSOLE=y This is new add
CONFIG_FRAMEBUFFER_CONSOLE=y

also, the following in
u-boot-2021.10\include\configs\mars-asic.h:

	/* config uart */
	#ifdef MAP_CONSOLE_TO_FBCON
		#define CONSOLEDEV "tty1\0" // This is for fbcon, new added by user
		#define CONSOLEDEV_SERIAL "ttyS0\0"
		#define MAP_FB_CON " fbcon=map:0\0"
	#else
		#define CONSOLEDEV_SERIAL "ttyS0\0"
		#define MAP_FB_CON " "
	#endif
	#define OTHERBOOTARGS   "earlycon=sbi riscv.fwsz="  __stringify(CVIMMAP_OPENSBI_SIZE) " " \
		EARLYCON_RELEASE CONSOLE_LOGLEVEL MAP_FB_CON
	#ifdef MAP_CONSOLE_TO_FBCON // This is for fbcon, new added by user
		#define CONFIG_EXTRA_ENV_SETTINGS	\
			"netdev=eth0\0"		\
			"consoledev=" CONSOLEDEV  \
			"consoledev_serial=" CONSOLEDEV_SERIAL  \
			"baudrate=115200\0" \
			"uImage_addr=" __stringify(UIMAG_ADDR) "\0" \
			"update_addr=" __stringify(UPDATE_ADDR) "\0" \
			"mtdparts=" PARTS "\0" \
			"mtdids=" MTDIDS_DEFAULT "\0" \
			"root=" ROOTARGS "\0" \
			"sddev=0\0" \
			"sdboot=" SD_BOOTM_COMMAND "\0" \
			"sdbootauto=" SD_BOOTM_COMMAND_AUTO "\0" \
			"othbootargs=" OTHERBOOTARGS "\0" \
			"loadenvcmd=mmc info;load mmc 0:1 ${uImage_addr} uEnv.txt; if test $? -eq 0; then env import ${uImage_addr} - ; fi;\0" \
			PARTS_OFFSET
	#else
	#ifdef MAP_CONSOLE_TO_FBCON // This is for fbcon, new added by user
		#define SET_BOOTARGS "setenv bootargs ${reserved_mem} ${root} ${mtdparts} " \
						"console=$consoledev $othbootargs;"
	#else

so that the bootargs=root=/dev/mmcblk0p2 rootwait rw console=tty1 earlycon=sbi riscv.fwsz=0x80000 loglevel=9 fbcon=map:0

I rebuilt it and created /boot/fb
when I do lsmod, soph_fbis enabled
and there is existing /dev/fb0

But still, no console was shown on the MIPI LCD

Hi, I would like to show the boot logs on the mipi LCD with frame buffer console, but I cannot get it working. I hv added the following in build\boards\sg200x\sg2002_licheervnano_sd\linux\sg2002_licheervnano_sd_defconfig: ``` CONFIG_FB=y # CONFIG_FB_CVITEK=m ## This is origional CONFIG_FB_CVITEK=y # CONFIG_FRAMEBUFFER_CONSOLE=y This is new add CONFIG_FRAMEBUFFER_CONSOLE=y ``` also, the following in u-boot-2021.10\include\configs\mars-asic.h: ``` /* config uart */ #ifdef MAP_CONSOLE_TO_FBCON #define CONSOLEDEV "tty1\0" // This is for fbcon, new added by user #define CONSOLEDEV_SERIAL "ttyS0\0" #define MAP_FB_CON " fbcon=map:0\0" #else #define CONSOLEDEV_SERIAL "ttyS0\0" #define MAP_FB_CON " " #endif ``` ``` #define OTHERBOOTARGS "earlycon=sbi riscv.fwsz=" __stringify(CVIMMAP_OPENSBI_SIZE) " " \ EARLYCON_RELEASE CONSOLE_LOGLEVEL MAP_FB_CON ``` ``` #ifdef MAP_CONSOLE_TO_FBCON // This is for fbcon, new added by user #define CONFIG_EXTRA_ENV_SETTINGS \ "netdev=eth0\0" \ "consoledev=" CONSOLEDEV \ "consoledev_serial=" CONSOLEDEV_SERIAL \ "baudrate=115200\0" \ "uImage_addr=" __stringify(UIMAG_ADDR) "\0" \ "update_addr=" __stringify(UPDATE_ADDR) "\0" \ "mtdparts=" PARTS "\0" \ "mtdids=" MTDIDS_DEFAULT "\0" \ "root=" ROOTARGS "\0" \ "sddev=0\0" \ "sdboot=" SD_BOOTM_COMMAND "\0" \ "sdbootauto=" SD_BOOTM_COMMAND_AUTO "\0" \ "othbootargs=" OTHERBOOTARGS "\0" \ "loadenvcmd=mmc info;load mmc 0:1 ${uImage_addr} uEnv.txt; if test $? -eq 0; then env import ${uImage_addr} - ; fi;\0" \ PARTS_OFFSET #else ``` ``` #ifdef MAP_CONSOLE_TO_FBCON // This is for fbcon, new added by user #define SET_BOOTARGS "setenv bootargs ${reserved_mem} ${root} ${mtdparts} " \ "console=$consoledev $othbootargs;" #else ``` so that the bootargs=root=/dev/mmcblk0p2 rootwait rw console=tty1 earlycon=sbi riscv.fwsz=0x80000 loglevel=9 fbcon=map:0 I rebuilt it and created /boot/fb when I do lsmod, soph_fbis enabled and there is existing /dev/fb0 But still, no console was shown on the MIPI LCD
markbirss commented 2024-09-30 08:05:31 -04:00 (Migrated from github.com)

@NathanChiu95

Kindly share the actual tree you are working from or the complete mars-asic.h file ?
It is unclear where and what order you are adding those lines

I last did this on the duo
https://www.youtube.com/watch?v=zAN8VrhhglE

@NathanChiu95 Kindly share the actual tree you are working from or the complete mars-asic.h file ? It is unclear where and what order you are adding those lines I last did this on the duo https://www.youtube.com/watch?v=zAN8VrhhglE
Neutree commented 2024-10-08 03:37:06 -04:00 (Migrated from github.com)

just create a empty file /boot/fb, reboot, then you can use FB

just create a empty file `/boot/fb`, reboot, then you can use FB
markbirss commented 2024-10-08 03:46:29 -04:00 (Migrated from github.com)

just create a empty file /boot/fb, reboot, then you can use FB

yes, just shows white screen with sipeed logo, no actual linux framebuffer console yet unfortunately

https://www.youtube.com/shorts/ewWXwE_knXg

> just create a empty file `/boot/fb`, reboot, then you can use FB yes, just shows white screen with sipeed logo, no actual linux framebuffer console yet unfortunately https://www.youtube.com/shorts/ewWXwE_knXg
NathanChiu95 commented 2024-10-15 02:34:43 -04:00 (Migrated from github.com)

@NathanChiu95

Kindly share the actual tree you are working from or the complete mars-asic.h file ? It is unclear where and what order you are adding those lines

I last did this on the duo https://www.youtube.com/watch?v=zAN8VrhhglE

Hi markbriss,

Please find the attached mars-asic.h
The macro MAP_CONSOLE_TO_FBCON is added by me
Thanks

mars-asic.zip

> @NathanChiu95 > > Kindly share the actual tree you are working from or the complete mars-asic.h file ? It is unclear where and what order you are adding those lines > > I last did this on the duo https://www.youtube.com/watch?v=zAN8VrhhglE Hi markbriss, Please find the attached mars-asic.h The macro MAP_CONSOLE_TO_FBCON is added by me Thanks [mars-asic.zip](https://github.com/user-attachments/files/17373656/mars-asic.zip)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
maxpeterkaya/LicheeRV-Nano-Build#52
No description provided.