Hi, On Fri, 2009-11-06 at 21:11 +0800, Wu Zhangjin wrote: > From: Wu Zhangjin <wuzhangjin@xxxxxxxxx> > > fuloong2f, yeeloong2f and menglong2f have different reset/shutdown > logic, this patch add respective support for them. > > Signed-off-by: Wu Zhangjin <wuzhangjin@xxxxxxxxx> > --- > arch/mips/include/asm/mach-loongson/loongson.h | 7 + > arch/mips/loongson/lemote-2f/Makefile | 2 +- > arch/mips/loongson/lemote-2f/reset.c | 163 ++++++++++++++++++++++++ > 3 files changed, 171 insertions(+), 1 deletions(-) > create mode 100644 arch/mips/loongson/lemote-2f/reset.c > [...] > + > +/* we only cope with the lemote 2f series */ > +typedef void (*mach_reset_func)(void); > +static mach_reset_func mach_reset[][2] = { > + [MACH_LOONGSON_UNKNOWN] {NULL, NULL}, > + [MACH_LEMOTE_FL2E] {NULL, NULL}, > + [MACH_LEMOTE_FL2F] {fl2f_reboot, fl2f_shutdown}, > + [MACH_LEMOTE_ML2F7] {ml2f_reboot, ml2f_shutdown}, > + [MACH_LEMOTE_YL2F89] {yl2f89_reboot, yl2f89_shutdown}, > + [MACH_DEXXON_GDIUM2F10] {NULL, NULL}, > + [MACH_LOONGSON_END] {NULL, NULL}, > +}; > + Here really waste some memory there, will replace it by the "switch..case" statements later. > +void mach_prepare_reboot(void) > +{ > + if (mach_reset[mips_machtype][0]) > + mach_reset[mips_machtype][0](); > +} > + > +void mach_prepare_shutdown(void) > +{ > + if (mach_reset[mips_machtype][1]) > + mach_reset[mips_machtype][1](); > +} Reagrds, Wu Zhangjin