
1 Oct
2015
1 Oct
'15
4:22 p.m.
Dear Fabio,
In message CAOMZO5ATtUjk_TVS94N6evTKndozVRH9nXyE0UHPJ3sCQ906Zg@mail.gmail.com you wrote:
Ok, the issue is due to endianness: on LS1021 the watchdog is big-endian, so that's why we can't use clrsetbits_le16().
...
int reg;
clrsetbits_le16(&wdog->wcr, 0, WCR_WDE);
reg = readw(&wdog->wcr);
reg |= WCR_WDE;
writew(reg, &wdog->wcr);
But this is broken. We have the clrsetbits() [*] macros exactly to avoid such code.
[*] resp. setbits() - using clrsetbits*() with 0 as clear mask is a stupid thing to do anyway.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
It is wrong always, everywhere and for everyone to believe anything
upon insufficient evidence. - W. K. Clifford, British philosopher,
circa 1876