@@ -3,20 +3,20 @@ use fdt_parser::{Fdt, FdtHeader};
33use core:: fmt:: Write ;
44use lazyinit:: LazyInit ;
55
6- static BOOTARGS_STR : LazyInit < heapless:: String < 256 > > = LazyInit :: new ( ) ;
6+ static BOOTARGS_STR : LazyInit < heapless:: String < 1024 > > = LazyInit :: new ( ) ;
77
88pub fn bootargs_message ( ) -> Option < & ' static str > {
99 let fdt_addr = crate :: get_bootarg ( ) ;
1010
1111 if fdt_addr == 0 {
1212 return None ;
1313 }
14-
14+ info ! ( "fdt_addr = {:#x}" , fdt_addr ) ;
1515 let virt_addr = crate :: mem:: phys_to_virt ( crate :: mem:: PhysAddr :: from ( fdt_addr) ) . as_usize ( ) ;
16-
16+ info ! ( "virt_addr = {:#x}" , virt_addr ) ;
1717 let fdt_header = unsafe {
18- let header_size = core:: mem:: size_of :: < FdtHeader > ( ) ;
1918 let ptr = virt_addr as * const u8 ;
19+ let header_size = core:: mem:: size_of :: < FdtHeader > ( ) ;
2020 core:: slice:: from_raw_parts ( ptr, header_size)
2121 } ;
2222
@@ -39,10 +39,12 @@ pub fn bootargs_message() -> Option<&'static str> {
3939 if let Some ( chosen) = fdt. chosen ( ) {
4040 if let Some ( bootargs) = chosen. bootargs ( ) {
4141 // Store bootargs in static variable
42- let mut bootargs_str = heapless:: String :: < 256 > :: new ( ) ;
42+ let mut bootargs_str = heapless:: String :: < 1024 > :: new ( ) ;
4343 if write ! ( bootargs_str, "{}" , bootargs) . is_ok ( ) {
4444 BOOTARGS_STR . init_once ( bootargs_str) ;
4545 return Some ( BOOTARGS_STR . as_str ( ) ) ;
46+ } else {
47+ error ! ( "Failed to write bootargs to static string" ) ;
4648 }
4749 }
4850 }
0 commit comments