[PATCH v3: For next 2/2] ARM: am33xx: Add support for reset reason detection

Wadim Egorov w.egorov at phytec.de
Wed Feb 11 01:57:50 PST 2015


On 11.02.2015 08:39, Sascha Hauer wrote:
> On Tue, Feb 10, 2015 at 03:13:58PM +0100, Wadim Egorov wrote:
>> Also activate in defconfig.
>>
>> Signed-off-by: Wadim Egorov <w.egorov at phytec.de>
>> +		break;
>> +	case (1 << 1):
>> +		reset_source_set(RESET_RST);
>> +		break;
>> +	case (1 << 0):
>> +		reset_source_set(RESET_POR);
>> +		break;
>> +	default:
>> +		reset_source_set(RESET_UKWN);
>> +		break;
>> +	}
>> +
>> +	return 0;
>> +}
>> +device_initcall(am33xx_detect_reset_reason);
> No SoC specific initcall without testing if you're running on the
> correct SoC please. Better call it from am33xx_init() which is only
> executed on am33xx.
>
> Sascha
Calling it from am33xx_init() was also my idea in the first place.
AFAIK you have to call reset_source_set() after coredevice_initcall().
So it is not possible to call it from am33xx_init().

But I can do a cpu check within am33xx_detect_reset_reason() and
cancel the detection if it is not an am335.
>
>




More information about the barebox mailing list