Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to enable frame buffer console #52

Open
NathanChiu95 opened this issue Sep 23, 2024 · 4 comments
Open

How to enable frame buffer console #52

NathanChiu95 opened this issue Sep 23, 2024 · 4 comments

Comments

@NathanChiu95
Copy link

NathanChiu95 commented Sep 23, 2024

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
Copy link

markbirss commented Sep 30, 2024

@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
Copy link
Member

Neutree commented Oct 8, 2024

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

@Neutree Neutree closed this as completed Oct 8, 2024
@markbirss
Copy link

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

@Neutree Neutree reopened this Oct 8, 2024
@NathanChiu95
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants