[PATCH 2/2] Add two architectures which can detect the reset source

Marc Kleine-Budde mkl at pengutronix.de
Wed Jun 20 11:09:54 EDT 2012


On 06/20/2012 05:05 PM, Juergen Beisert wrote:
> Marc Kleine-Budde wrote:
>> [...]
>>> +static int s3c_detect_reset_source(void)
>>> +{
>>> +	u32 reg = readl(S3C_GPIO_BASE + S3C2440_GSTATUS2);
>>> +
>>> +	if (reg & S3C2440_GSTATUS2_PWRST) {
>>> +		set_reset_source(RESET_POR);
>>> +		writel(S3C2440_GSTATUS2_PWRST,
>                                         ^^^^^
>>> +					S3C_GPIO_BASE + S3C2440_GSTATUS2);
>>> +		return 0;
>>> +	}
>>> +
>>> +	if (reg & S3C2440_GSTATUS2_SLEEPRST) {
>>> +		set_reset_source(RESET_WKE);
>>> +		writel(S3C2440_GSTATUS2_SLEEPRST,
>                                         ^^^^^^^^
>>> +					S3C_GPIO_BASE + S3C2440_GSTATUS2);
>>> +		return 0;
>>> +	}
>>> +
>>> +	if (reg & S3C2440_GSTATUS2_WDRST) {
>>> +		set_reset_source(RESET_WDG);
>>> +		writel(S3C2440_GSTATUS2_WDRST,
>                                         ^^^^^
>>> +					S3C_GPIO_BASE + S3C2440_GSTATUS2);
>>> +		return 0;
>>> +	}
>>
>> That "writel(S3C2440_GSTATUS2_WDRST...)" is the same in each line, isn't
>> it?
> 
> Take a closer look. ;)

tnx - you're rifht

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 262 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20120620/5e326586/attachment.sig>


More information about the barebox mailing list