mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Correct duplicate /cpus and more (Laurent Vivier)
Correct duplicate /cpus Correct mmu properties in /chosen Add mmu methods to /cpus/<cpu> git-svn-id: svn://coreboot.org/openbios/openbios-devel@341 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
@@ -489,7 +489,7 @@ arch_of_init( void )
|
|||||||
#endif
|
#endif
|
||||||
snprintf(buf, sizeof(buf), "/cpus/%s", cpu->name);
|
snprintf(buf, sizeof(buf), "/cpus/%s", cpu->name);
|
||||||
ofmem_register(find_dev(buf));
|
ofmem_register(find_dev(buf));
|
||||||
node_methods_init();
|
node_methods_init(buf);
|
||||||
|
|
||||||
#ifdef USE_RTAS
|
#ifdef USE_RTAS
|
||||||
if( !(ph=find_dev("/rtas")) )
|
if( !(ph=find_dev("/rtas")) )
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ extern char of_rtas_start[], of_rtas_end[];
|
|||||||
extern void call_elf( ulong elf_entry );
|
extern void call_elf( ulong elf_entry );
|
||||||
|
|
||||||
/* methods.c */
|
/* methods.c */
|
||||||
extern void node_methods_init( void );
|
extern void node_methods_init( const char *cpuname );
|
||||||
|
|
||||||
/* main.c */
|
/* main.c */
|
||||||
extern void boot( void );
|
extern void boot( void );
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ NODE_METHODS( ciface ) = {
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
DECLARE_NODE( memory, INSTALL_OPEN, 0, "/memory" );
|
DECLARE_NODE( memory, INSTALL_OPEN, 0, "/memory" );
|
||||||
DECLARE_NODE( mmu, INSTALL_OPEN, 0, "/cpu@0" );
|
DECLARE_UNNAMED_NODE( mmu, INSTALL_OPEN, 0 );
|
||||||
DECLARE_NODE( mmu_ciface, 0, 0, "+/openprom/client-services" );
|
DECLARE_NODE( mmu_ciface, 0, 0, "+/openprom/client-services" );
|
||||||
|
|
||||||
|
|
||||||
@@ -291,14 +291,21 @@ NODE_METHODS( mmu_ciface ) = {
|
|||||||
/************************************************************************/
|
/************************************************************************/
|
||||||
|
|
||||||
void
|
void
|
||||||
node_methods_init( void )
|
node_methods_init( const char *cpuname )
|
||||||
{
|
{
|
||||||
|
phandle_t chosen, ph;
|
||||||
#ifdef USE_RTAS
|
#ifdef USE_RTAS
|
||||||
REGISTER_NODE( rtas );
|
REGISTER_NODE( rtas );
|
||||||
#endif
|
#endif
|
||||||
REGISTER_NODE( ciface );
|
REGISTER_NODE( ciface );
|
||||||
REGISTER_NODE( memory );
|
REGISTER_NODE( memory );
|
||||||
REGISTER_NODE( mmu );
|
REGISTER_NODE_METHODS( mmu, cpuname );
|
||||||
REGISTER_NODE( mmu_ciface );
|
REGISTER_NODE( mmu_ciface );
|
||||||
REGISTER_NODE( tty );
|
REGISTER_NODE( tty );
|
||||||
|
|
||||||
|
chosen = find_dev("/chosen");
|
||||||
|
if (chosen) {
|
||||||
|
ph = find_dev(cpuname);
|
||||||
|
set_int_property(chosen, "mmu", ph);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
:noname
|
:noname
|
||||||
" rtc" " rtc" preopen
|
" rtc" " rtc" preopen
|
||||||
" memory" " /memory" preopen
|
" memory" " /memory" preopen
|
||||||
" mmu" " /cpu@0" preopen
|
|
||||||
\ " stdout" " /packages/terminal-emulator" preopen
|
\ " stdout" " /packages/terminal-emulator" preopen
|
||||||
" stdout" " screen" preopen
|
" stdout" " screen" preopen
|
||||||
" stdin" " adb-keyboard" preopen
|
" stdin" " adb-keyboard" preopen
|
||||||
|
|||||||
@@ -35,13 +35,6 @@ new-device
|
|||||||
: close ;
|
: close ;
|
||||||
finish-device
|
finish-device
|
||||||
|
|
||||||
new-device
|
|
||||||
" cpus" device-name
|
|
||||||
" cpus" device-type
|
|
||||||
1 encode-int " #address-cells" property
|
|
||||||
0 encode-int " #size-cells" property
|
|
||||||
finish-device
|
|
||||||
|
|
||||||
\ -------------------------------------------------------------
|
\ -------------------------------------------------------------
|
||||||
\ /packages
|
\ /packages
|
||||||
\ -------------------------------------------------------------
|
\ -------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user