1.1 --- a/stage2/board.c Sat May 14 22:47:06 2016 +0200
1.2 +++ b/stage2/board.c Sat May 14 23:46:35 2016 +0200
1.3 @@ -3,7 +3,7 @@
1.4 *
1.5 * Copyright (C) 2005-2006 Ingenic Semiconductor, <jlwei@ingenic.cn>
1.6 * Copyright (C) Xiangfu Liu <xiangfu.z@gmail.com>
1.7 - * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk>
1.8 + * Copyright (C) 2015, 2016 Paul Boddie <paul@boddie.org.uk>
1.9 *
1.10 * This program is free software: you can redistribute it and/or modify
1.11 * it under the terms of the GNU General Public License as published by
1.12 @@ -82,7 +82,7 @@
1.13 timestamp = t;
1.14 }
1.15
1.16 -void udelay (unsigned long usec)
1.17 +void udelay(unsigned long usec)
1.18 {
1.19 unsigned long tmo,tmp;
1.20
1.21 @@ -111,7 +111,7 @@
1.22 while (get_timer_masked () < tmo);
1.23 }
1.24
1.25 -void udelay_masked (unsigned long usec)
1.26 +void udelay_masked(unsigned long usec)
1.27 {
1.28 unsigned long tmo;
1.29 unsigned long endtime;
1.30 @@ -156,3 +156,25 @@
1.31 {
1.32 return TIMER_HZ;
1.33 }
1.34 +
1.35 +/* GPIO interrupt administration. */
1.36 +
1.37 +void gpio_clear(u8 gpio)
1.38 +{
1.39 + /* Clear interrupt status. */
1.40 +
1.41 + __gpio_ack_irq(gpio);
1.42 + __intc_ack_irq(GPIO_IRQ);
1.43 +}
1.44 +
1.45 +/* Miscellaneous interrupt administration. */
1.46 +
1.47 +void irq_clear()
1.48 +{
1.49 + u8 i;
1.50 +
1.51 + for (i = 0; i < 32; i++) {
1.52 + if (REG_INTC_IPR & (1 << i))
1.53 + __intc_ack_irq(i);
1.54 + }
1.55 +}