Alon, There are at least two other ways that you might be able to reset a board: 1) Internally through the ICAP device. 2) Through a GPIO connected externally to the reset logic.
Part of this is board specific, part of is it design specific. Probably it would be best to have a mechanism in the device tree which references the reset mechanism? In any event, you probably don't want a driver to eplicitly reference the plaform code. If you want to do it explicitly like this, it would better to have the plaform code reference the driver mechanism. This would, to some extent, generalize to the device tree case. Steve > -----Original Message----- > From: linuxppc-dev-bounces+stephen=neuendorffer.n...@lists.ozlabs.org [mailto:linuxppc-dev- > bounces+stephen=neuendorffer.n...@lists.ozlabs.org] On Behalf Of Alon Ziv > Sent: Sunday, November 15, 2009 1:34 AM > To: linuxppc-dev > Subject: [PATCH/RFC] Booting Xilinx ML510 board using SystemACE > > I am using locally the attached (hackish) patch; could someone propose a > way to make it acceptable to mainline (or should I just keep this > quiet)? > > diff --git a/arch/powerpc/platforms/44x/virtex.c > b/arch/powerpc/platforms/44x/virtex.c > index cf96cca..749a330 100644 > --- a/arch/powerpc/platforms/44x/virtex.c > +++ b/arch/powerpc/platforms/44x/virtex.c > @@ -51,6 +51,16 @@ static int __init virtex_probe(void) > return 1; > } > > +void (*board_reset_system)(char *); > +EXPORT_SYMBOL(board_reset_system); > + > +static void virtex_reset_system(char *cmd) > +{ > + if (board_reset_system) > + board_reset_system(cmd); > + ppc4xx_reset_system(cmd); > +} > + > define_machine(virtex) { > .name = "Xilinx Virtex440", > .probe = virtex_probe, > @@ -58,5 +68,5 @@ define_machine(virtex) { > .init_IRQ = xilinx_intc_init_tree, > .get_irq = xilinx_intc_get_irq, > .calibrate_decr = generic_calibrate_decr, > - .restart = ppc4xx_reset_system, > + .restart = virtex_reset_system, > }; > diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c > index b20abe1..f3b4ab9 100644 > --- a/drivers/block/xsysace.c > +++ b/drivers/block/xsysace.c > @@ -950,6 +950,19 @@ static struct block_device_operations ace_fops = { > .getgeo = ace_getgeo, > }; > > +extern void (*board_reset_system)(char *); > +static struct ace_device *the_ace_device; > + > +/* -------------------------------------------------------------------- > + * Board reset using ACE (forced FPGA reconfigure) > + */ > +static void ace_reset_system(char *cmd) > +{ > + printk(KERN_EMERG "ace_reset_system: attempting suicide\n"); > + ace_out(the_ace_device, ACE_CTRL, ACE_CTRL_FORCECFGMODE | > + ACE_CTRL_CFGMODE | ACE_CTRL_CFGSTART | ACE_CTRL_CFGSEL); > +} > + > /* -------------------------------------------------------------------- > * SystemACE device setup/teardown code > */ > @@ -1040,6 +1053,9 @@ static int __devinit ace_setup(struct ace_device > *ace) > val |= ACE_CTRL_DATABUFRDYIRQ | ACE_CTRL_ERRORIRQ; > ace_out(ace, ACE_CTRL, val); > > + board_reset_system = ace_reset_system; > + the_ace_device = ace; > + > /* Print the identification */ > dev_info(ace->dev, "Xilinx SystemACE revision %i.%i.%i\n", > (version >> 12) & 0xf, (version >> 8) & 0x0f, version & > 0xff); > ************************************************************************ ********************** > IMPORTANT: The contents of this email and any attachments are confidential. They are intended for the > named recipient(s) only. > If you have received this email in error, please notify the system manager or the sender immediately > and do > not disclose the contents to anyone or make copies thereof. > > > _______________________________________________ > Linuxppc-dev mailing list > Linuxppc-dev@lists.ozlabs.org > https://lists.ozlabs.org/listinfo/linuxppc-dev This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately. _______________________________________________ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev