[Skiboot] [PATCH 12/12] add little endian support

Nicholas Piggin npiggin at gmail.com
Wed Oct 2 14:41:54 AEST 2019


Oliver O'Halloran's on October 1, 2019 4:04 pm:
> On Sun, 2019-09-29 at 17:46 +1000, Nicholas Piggin wrote:
>> @@ -333,6 +336,8 @@ boot_offset:
>>   */
>>  .global boot_entry
>>  boot_entry:
>> +	FIXUP_ENDIAN
>> +boot_entry_fixed:
> 
> Is there any point having boot_entry and boot_entry_fixed? IIRC
> boot_entry is internal to skiboot so we would have to be in the correct
> endian to get there in the first place.

Possibly now leftover, that was quite early on when I was trying to
figure out what hostboot was doing.

>> @@ -347,6 +352,7 @@ boot_entry:
>>  	beq 	1f
>>  	cmpwi	cr0,%r3,PVR_TYPE_P9P
>>  	beq 	1f
>> +	b	.
>>  	attn		/* Unsupported CPU type... what do we do ? */
>>  	b 	.	/* loop here, just in case attn is disabled */
> 
> Debug hack?

Yes, will fix.

>> @@ -28,6 +28,23 @@
>>  /* Load an address via the TOC */
>>  #define LOAD_ADDR_FROM_TOC(r, e)	ld r,e at got(%r2)
>>  
>> +#if HAVE_BIG_ENDIAN
>> +#define OPAL_ENTRY_TO_SKIBOOT_ENDIAN
>> +#else
>> +/* This must preserve LR, so can't use FIXUP_ENDIAN */
>> +#define OPAL_ENTRY_TO_SKIBOOT_ENDIAN				   \
>> +	.long 0xa600607d; /* mfmsr r11				*/ \
>> +	.long 0x01006b69; /* xori r11,r11,1			*/ \
>> +	.long 0xa64b7b7d; /* mthsrr1 r11			*/ \
>> +	.long 0xa602687d; /* mflr r11				*/ \
>> +	.long 0x05009f42; /* bcl 20,31,$+4			*/ \
>> +	.long 0xa602487d; /* mflr r10				*/ \
>> +	.long 0x14004a39; /* addi r10,r10,20			*/ \
>> +	.long 0xa64b5a7d; /* mthsrr0 r10			*/ \
>> +	.long 0xa603687d; /* mtlr r11				*/ \
>> +	.long 0x2402004c  /* hrfid				*/
>> +#endif
> 
> Any reason we can't just use this for FIXUP_ENDIAN instead of having
> two slightly different versions?

Possibly we could. FIXUP_ENDIAN comes exactly from Linux but if we
have to maintain a different thing anyway just one makes sense.

Thanks,
Nick



More information about the Skiboot mailing list