From: Jean-Christophe PLAGNIOL-VILLARD Date: Wed, 19 Mar 2008 13:17:28 +0100 Subject: [U-Boot-Users] [PATCH] The patch adds new POST tests for the Lwmon5 board. In-Reply-To: <1205874767-19726-2-git-send-email-wd@denx.de> References: <1205874767-19726-1-git-send-email-wd@denx.de> <1205874767-19726-2-git-send-email-wd@denx.de> Message-ID: <20080319121728.GB14030@game.jcrosoft.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 22:12 Tue 18 Mar , Wolfgang Denk wrote: > From: Yuri Tikhonov > > * External Watchdog test; > * dsPIC tests; > * FPGA test; > * GDC test; > * Sysmon tests. > > Signed-off-by: Dmitry Rakhchev > Signed-off-by: Yuri Tikhonov > --- > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > + * MA 02111-1307 USA > + */ > + > +#include > + > +#ifdef CONFIG_POST Please move it to the Makefile > + > +#include > + > + > +#if CONFIG_POST & CFG_POST_DSP > +#include > + > +/* This test verifies DSP status bits in FPGA */ > + > +DECLARE_GLOBAL_DATA_PTR; > + > +#define DSP_STATUS_REG 0xC4000008 > + > +int dsp_post_test(int flags) > +{ > + uint read_value; > + int ret; > + > + ret = 0; > + read_value = in_be32((void *)DSP_STATUS_REG) & 0x3; > + if (read_value != 0x3) { > + post_log("\nDSP status read %08X\n", read_value); > + ret = 1; > + } > + > + return ret; > +} > + > +#endif /* CONFIG_POST & CFG_POST_DSP */ > +#endif /* CONFIG_POST */ > + > diff --git a/post/board/lwmon5/dspic.c b/post/board/lwmon5/dspic.c > new file mode 100644 > index 0000000..e8fed89 > --- /dev/null > +++ b/post/board/lwmon5/dspic.c > @@ -0,0 +1,109 @@ > +/* > + * (C) Copyright 2008 Dmitry Rakhchev, EmCraft Systems, rda at emcraft.com > + * > + * Developed for DENX Software Engineering GmbH > + * > + * See file CREDITS for list of people who contributed to this > + * project. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > + * MA 02111-1307 USA > + */ > + > +#include > + > +#ifdef CONFIG_POST Please move it to the Makefile > + > +/* There are two tests for dsPIC currently implemented: > + * 1. dsPIC ready test. Done in board_early_init_f(). Only result verified here. > + * 2. dsPIC POST result test. This test gets dsPIC POST codes and version. > + */ > + > index 0000000..4e3f1d5 > --- /dev/null > +++ b/post/board/lwmon5/fpga.c > @@ -0,0 +1,104 @@ > +/* > + * (C) Copyright 2008 Dmitry Rakhchev, EmCraft Systems, rda at emcraft.com > + * > + * Developed for DENX Software Engineering GmbH > + * > + * See file CREDITS for list of people who contributed to this > + * project. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > + * MA 02111-1307 USA > + */ > +#include > + > +#ifdef CONFIG_POST Please move it to the Makefile > + > +/* This test performs testing of FPGA SCRATCH register, > + * gets FPGA version and run get_ram_size() on FPGA memory > + */ > + > +#include > + > +#include > + > + * Developed for DENX Software Engineering GmbH > + * > + * See file CREDITS for list of people who contributed to this > + * project. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > + * MA 02111-1307 USA > + */ > +#include > + > +#ifdef CONFIG_POST Please move it to the Makefile > + > +/* This test attempts to verify board GDC. A scratch register tested, then > + * simple memory test (get_ram_size()) run over GDC memory. > + */ > + > +#include > + > +#include > + > +DECLARE_GLOBAL_DATA_PTR; > + > +#define GDC_SCRATCH_REG 0xC1FF8044 > +#define GDC_VERSION_REG 0xC1FF8084 > +#define GDC_RAM_START 0xC0000000 > +#define GDC_RAM_END 0xC2000000 > + > + * See file CREDITS for list of people who contributed to this > + * project. > + * > + * This program is free software; you can redistribute it and/or > + * modify it under the terms of the GNU General Public License as > + * published by the Free Software Foundation; either version 2 of > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > + * MA 02111-1307 USA > + */ > + > +#include > +#include > + > +#ifdef CONFIG_POST Please move it to the Makefile > + > +/* > + * SYSMON test > + * > + * the License, or (at your option) any later version. > + * > + * This program is distributed in the hope that it will be useful, > + * but WITHOUT ANY WARRANTY; without even the implied warranty of > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + * GNU General Public License for more details. > + * > + * You should have received a copy of the GNU General Public License > + * along with this program; if not, write to the Free Software > + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, > + * MA 02111-1307 USA > + */ > + > +#include > + > +/* This test verifies if the reason of last reset was an abnormal voltage > + * condition, than it performs watchdog test, measuing time required to > + * trigger watchdog reset. > + */ > + > +#ifdef CONFIG_POST Please move it to the Makefile > + > +#include > + > +#if CONFIG_POST & CFG_POST_WATCHDOG > + Best Regards, J.