Add a "View I/O Ports" screen for imx31. Show all GPIO contents.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17072 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
97e61198a5
commit
57742e0ef7
5 changed files with 120 additions and 5 deletions
|
@ -94,7 +94,8 @@
|
|||
#include "pcf50605.h"
|
||||
#endif
|
||||
|
||||
#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801
|
||||
#if CONFIG_CPU == DM320 || CONFIG_CPU == S3C2440 || CONFIG_CPU == TCC7801 \
|
||||
|| CONFIG_CPU == IMX31L
|
||||
#include "debug-target.h"
|
||||
#endif
|
||||
|
||||
|
@ -2407,7 +2408,8 @@ static const struct the_menu_item menuitems[] = {
|
|||
(defined(CPU_PP) && !(defined(SANSA_E200) || defined(SANSA_C200)))
|
||||
{ "Dump ROM contents", dbg_save_roms },
|
||||
#endif
|
||||
#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) || CONFIG_CPU == S3C2440
|
||||
#if CONFIG_CPU == SH7034 || defined(CPU_COLDFIRE) || defined(CPU_PP) \
|
||||
|| CONFIG_CPU == S3C2440 || CONFIG_CPU == IMX31L
|
||||
{ "View I/O ports", dbg_ports },
|
||||
#endif
|
||||
#if (CONFIG_RTC == RTC_PCF50605) && !defined(SIMULATOR)
|
||||
|
|
|
@ -642,6 +642,7 @@ target/arm/s3c2440/gigabeat-fx/wmcodec-meg-fx.c
|
|||
#ifndef SIMULATOR
|
||||
target/arm/lcd-as-memframe.S
|
||||
target/arm/mmu-arm.c
|
||||
target/arm/imx31/debug-imx31.c
|
||||
target/arm/imx31/gigabeat-s/adc-imx31.c
|
||||
target/arm/imx31/gigabeat-s/ata-imx31.c
|
||||
target/arm/imx31/gigabeat-s/avic-imx31.c
|
||||
|
|
91
firmware/target/arm/imx31/debug-imx31.c
Normal file
91
firmware/target/arm/imx31/debug-imx31.c
Normal file
|
@ -0,0 +1,91 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2008 by Michael Sevakis
|
||||
*
|
||||
* All files in this archive are subject to the GNU General Public License.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "string.h"
|
||||
#include "button.h"
|
||||
#include "lcd.h"
|
||||
#include "sprintf.h"
|
||||
#include "font.h"
|
||||
#include "debug-target.h"
|
||||
|
||||
bool __dbg_hw_info(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
bool __dbg_ports(void)
|
||||
{
|
||||
char buf[50];
|
||||
int line;
|
||||
|
||||
lcd_setmargins(0, 0);
|
||||
lcd_clear_display();
|
||||
lcd_setfont(FONT_SYSFIXED);
|
||||
|
||||
while(1)
|
||||
{
|
||||
line = 0;
|
||||
snprintf(buf, sizeof(buf), "[Ports and Registers]");
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
|
||||
/* GPIO1 */
|
||||
snprintf(buf, sizeof(buf), "GPIO1: DR: %08lx GDIR: %08lx", GPIO1_DR, GPIO1_GDIR);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO1_PSR, GPIO1_ICR1);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO1_ICR2, GPIO1_IMR);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO1_ISR);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
|
||||
/* GPIO2 */
|
||||
snprintf(buf, sizeof(buf), "GPIO2: DR: %08lx GDIR: %08lx", GPIO2_DR, GPIO2_GDIR);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO2_PSR, GPIO2_ICR1);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO2_ICR2, GPIO2_IMR);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO2_ISR);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
|
||||
/* GPIO3 */
|
||||
snprintf(buf, sizeof(buf), "GPIO3: DR: %08lx GDIR: %08lx", GPIO3_DR, GPIO3_GDIR);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " PSR: %08lx ICR1: %08lx", GPIO3_PSR, GPIO3_ICR1);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ICR2: %08lx IMR: %08lx", GPIO3_ICR2, GPIO3_IMR);
|
||||
lcd_puts(0, line++, buf);
|
||||
|
||||
snprintf(buf, sizeof(buf), " ISR: %08lx", GPIO3_ISR);
|
||||
lcd_puts(0, line++, buf); line++;
|
||||
|
||||
lcd_update();
|
||||
if (button_get_w_tmo(HZ/10) == (DEBUG_CANCEL|BUTTON_REL))
|
||||
return false;
|
||||
}
|
||||
}
|
24
firmware/target/arm/imx31/debug-target.h
Normal file
24
firmware/target/arm/imx31/debug-target.h
Normal file
|
@ -0,0 +1,24 @@
|
|||
/***************************************************************************
|
||||
* __________ __ ___.
|
||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||
* \/ \/ \/ \/ \/
|
||||
* $Id$
|
||||
*
|
||||
* Copyright (C) 2007 by Karl Kurbjun
|
||||
*
|
||||
* All files in this archive are subject to the GNU General Public License.
|
||||
* See the file COPYING in the source tree root for full license agreement.
|
||||
*
|
||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||
* KIND, either express or implied.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define DEBUG_CANCEL BUTTON_BACK
|
||||
bool __dbg_hw_info(void);
|
||||
bool __dbg_ports(void);
|
||||
|
||||
|
|
@ -30,9 +30,6 @@ static inline void udelay(unsigned int usecs)
|
|||
while ((signed int)EPITCNT1 > stop);
|
||||
}
|
||||
|
||||
#define __dbg_hw_info(...) 0
|
||||
#define __dbg_ports(...) 0
|
||||
|
||||
void system_prepare_fw_start(void);
|
||||
void tick_stop(void);
|
||||
void kernel_device_init(void);
|
||||
|
|
Loading…
Reference in a new issue