Compare commits

..

28 Commits

Author SHA1 Message Date
be662e9a6b Prepare v2011.12-rc3
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-21 20:39:46 +01:00
e2132c29d8 arm: Tegra: fix undefined instruction hang immediately after reset
commit 0d479b53 (Aneesh V) added code for OMAP4 that doesn't
execute on Tegra, due to the AVP (ARM7TDI) not having a CP15.
Result was an undefined instruction hang just after reset.

Signed-off-by: Tom Warren <twarren@nvidia.com>
Cc: Albert Aribaud <albert.u.boot@aribaud.net>
Cc: Tom Rini <trini@ti.com>
Acked-by: Aneesh V <aneesh@ti.com>
2011-12-21 20:36:22 +01:00
7aecfdd0f8 doc/mkimage.1: Fix some typos
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-21 20:27:18 +01:00
d26982cbb6 km/common: add toolchain variable
Add a variable "toolchain" and configure the rootpath
for the nfsargs with this variable.

Signed-off-by: Holger Brunck <holger.brunck@keymile.com>
cc: Wolfgang Denk <wd@denx.de>
2011-12-20 23:43:45 +01:00
37d0e77777 Makefile: fix distclean and *_config rules to be less noise
Signed-off-by: Lauri Hintsala <lauri.hintsala@bluegiga.com>
2011-12-20 23:37:20 +01:00
c3e17d5c9e board/eltec/elppc/misc.c: Fix GCC 4.6 build warning
Fix:
misc.c: In function 'misc_init_r':
misc.c:119:3: warning: dereferencing type-punned pointer
will break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-12-20 23:21:38 +01:00
40867a2fe1 drivers/net/e1000.c: Fix GCC 4.6 build warnings
Fix:
e1000.c: In function 'e1000_read_mac_addr':
e1000.c:1149:2: warning: dereferencing type-punned pointer
will break strict-aliasing rules [-Wstrict-aliasing]

e1000.c:1149:2: warning: dereferencing type-punned pointer
will break strict-aliasing rules [-Wstrict-aliasing]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Acked-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
2011-12-20 23:21:03 +01:00
821315fe2f board/esd/cpci750/mv_eth.c: Fix GCC 4.6 build warnings
Fix:
mv_eth.c: In function 'mv64360_eth_real_open':
mv_eth.c:425:6: warning: variable 'port_status' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_stop':
mv_eth.c:643:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_xmit':
mv_eth.c:719:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_receive':
mv_eth.c:804:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_get_stats':
mv_eth.c:903:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_update_stat':
mv_eth.c:931:24: warning: variable 'dummy' set but not used [-Wunused-but-set-variable]
mv_eth.c:930:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'mv64360_eth_print_stat':
mv_eth.c:1012:15: warning: variable 'port_num' set but not used [-Wunused-but-set-variable]
mv_eth.c: In function 'eth_clear_mib_counters':
mv_eth.c:2069:15: warning: variable 'dummy' set but not used [-Wunused-but-set-variable

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Reinhard Arlt <reinhard.arlt@esd.eu>
2011-12-20 23:20:27 +01:00
ea2d915974 usb: s3c_udc_otg: fix GCC 4.6 build warnings
Fix:
In file included from s3c_udc_otg.c:216:0:
s3c_udc_otg_xfer_dma.c: In function 'complete_tx':
s3c_udc_otg_xfer_dma.c:280:33: warning: variable 'is_short' set but not used
s3c_udc_otg_xfer_dma.c:280:6: warning: variable 'ep_tsr' set but not used
s3c_udc_otg_xfer_dma.c: In function 's3c_udc_irq':
s3c_udc_otg_xfer_dma.c:469:16: warning: variable 'flags' set but not used
s3c_udc_otg_xfer_dma.c:468:18: warning: variable 'gintmsk' set but not used
s3c_udc_otg_xfer_dma.c: In function 's3c_queue':
s3c_udc_otg_xfer_dma.c:582:14: warning: variable 'gintsts' set but not used
s3c_udc_otg_xfer_dma.c:581:16: warning: variable 'flags' set but not used
s3c_udc_otg_xfer_dma.c: In function 's3c_ep0_read':
s3c_udc_otg_xfer_dma.c:778:6: warning: variable 'ret' set but not used
s3c_udc_otg_xfer_dma.c: In function 's3c_udc_set_halt':
s3c_udc_otg_xfer_dma.c:1020:16: warning: variable 'flags' set but not used
s3c_udc_otg_xfer_dma.c: In function 's3c_ep0_setup':
s3c_udc_otg_xfer_dma.c:1258:13: warning: initialization from incompatible
pointer type [enabled by default]
s3c_udc_otg_xfer_dma.c:1239:16: warning: variable 'is_in' set but not used
s3c_udc_otg_xfer_dma.c:1239:9: warning: variable 'bytes' set but not used
s3c_udc_otg.c: In function 'usb_gadget_register_driver':
s3c_udc_otg.c:292:16: warning: variable 'flags' set but not used
s3c_udc_otg.c: In function 'usb_gadget_unregister_driver':
s3c_udc_otg.c:338:16: warning: variable 'flags' set but not used
s3c_udc_otg.c: In function 's3c_ep_enable':
s3c_udc_otg.c:582:16: warning: variable 'flags' set but not used
s3c_udc_otg.c: In function 's3c_ep_disable':
s3c_udc_otg.c:646:16: warning: variable 'flags' set but not used
s3c_udc_otg.c: In function 's3c_dequeue':
s3c_udc_otg.c:704:16: warning: variable 'flags' set but not used

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Remy Bohmer <linux@bohmer.net>
2011-12-20 23:20:01 +01:00
e03492c875 board/samsung/universal_c210/universal.c: Fix build warning
Fix:
universal.c: In function 's5pc210_phy_control':
universal.c:273:7: warning: 'ret' may be used uninitialized
in this function [-Wuninitialized]

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
2011-12-20 23:19:18 +01:00
8506eb8d6a FAT: fix some issues in FAT write support code
Writing a file to the FAT partition didn't work while a
test using a CF card. The test was done on mpc5200 based
board (powerpc). There is a number of problems in FAT
write code:

Compiler warning:
fat_write.c: In function 'file_fat_write':
fat_write.c:326: warning: 'counter' may be used uninitialized
in this function
fat_write.c:326: note: 'counter' was declared here

'l_filename' string is not terminated, so a file name
with garbage at the end is used as a file name as shown
by debug code.

Return value of set_contents() is not checked properly
so actually a file won't be written at all (as checked
using 'fatls' after a write attempt with 'fatwrite'
command).

do_fat_write() doesn't return the number of written bytes
if no error happened. However the return value of this
function is used to show the number of written bytes
in do_fat_fswrite().

The patch adds some debug code and fixes above mentioned
problems and also fixes a typo in error output.

NOTE: after a successful write to the FAT partition (under
U-Boot) the partition was checked under Linux using fsck.
The partition needed fixing FATs:
-bash-3.2# fsck -a /dev/sda1
fsck 1.39 (29-May-2006)
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
FATs differ but appear to be intact. Using first FAT.
Performing changes.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Cc: Aaron Williams <Aaron.Williams@cavium.com>
Acked-by: Donggeun Kim <dg77.kim@samsung.com>
2011-12-20 23:18:43 +01:00
e27334212c Merge branch 'master' of /home/wd/git/u-boot/custodians
* 'master' of /home/wd/git/u-boot/custodians:
  common/cmd_pxe.c: Fix GCC 4.6 build warnings
  AVR32: fix timer_init() function
2011-12-20 23:14:37 +01:00
c89fd4f0a2 Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
* 'agust@denx.de' of git://git.denx.de/u-boot-staging:
  common/cmd_pxe.c: Fix GCC 4.6 build warnings
  AVR32: fix timer_init() function
2011-12-20 23:14:32 +01:00
deb7282f9f drivers/net/e1000_spi.c: Fix build warnings
Fix:
e1000_spi.c: In function 'spi_free_slave':
e1000_spi.c:115: warning: unused variable 'hw'
e1000_spi.c: In function 'do_e1000_spi':
e1000_spi.c:472: warning: 'checksum' may be used uninitialized in this function
e1000_spi.c:472: note: 'checksum' was declared here

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Acked-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
2011-12-20 23:13:49 +01:00
38bd80b485 net: Fix arguments in tftpput command
The switch to strict_strtoul() was not done correctly - this fixes
the compile error when CONFIG_CMD_TFTPPUT is active.

There appears to very little use of strict_strtoul() in commands, so
it might be easier to switch to simple_strtoul(). If not, we should
decide the best way to use strict_strtoul(). For now I have added a
friendly message which will of course increase code size.

Signed-off-by: Simon Glass <sjg@chromium.org>
2011-12-20 23:12:32 +01:00
bf0b631343 AVR32: fix timer_init() function
timer_init() now returns an int (the error code) instead of void.
This makes compilation fail with:

interrupts.c:111: error: conflicting types for 'timer_init'
/home/svens/u-boot/u-boot/include/common.h:246: error: previous
declaration of 'timer_init' was here
make[1]: *** [interrupts.o] Error 1

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-12-20 23:10:04 +01:00
43d4a5e687 common/cmd_pxe.c: Fix GCC 4.6 build warnings
Fix:
cmd_pxe.c: In function 'parse_pxefile_top':
cmd_pxe.c:941:5: warning: 'err' may be used uninitialized in this
  function [-Wuninitialized]
cmd_pxe.c:921:6: note: 'err' was declared here

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Jason Hobbs <jason.hobbs@calxeda.com>
Acked-by: Jason Hobbs <jason.hobbs@calxeda.com>
2011-12-20 22:28:51 +01:00
c0e6723ee4 AVR32: fix timer_init() function
timer_init() now returns an int (the error code) instead of void.
This makes compilation fail with:

interrupts.c:111: error: conflicting types for 'timer_init'
/home/svens/u-boot/u-boot/include/common.h:246: error: previous
declaration of 'timer_init' was here
make[1]: *** [interrupts.o] Error 1

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-12-20 22:28:51 +01:00
e570fe8ef2 PXA: Kill last remnants of set_GPIO_mode function
GPIO configuration shall never be done inside a driver, never.

Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
2011-12-19 17:52:44 +01:00
159dad650c ARM: tny_a9260: re-add MACH_TYPE_TNY_A9G20 and MACH_TYPE_TNY_A9260
MACH_TYPE_TNY_A9G20 and MACH_TYPE_TNY_A9260 were removed
from mach-types.h. Add them to the board config file.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
2011-12-19 17:52:44 +01:00
204ab93f7e ARM: sbc35_a9g20: re-add MACH_TYPE_SBC35_A9G20
MACH_TYPE_SBC35_A9G20 was removed from mach-types.h.
Add it to the board config file.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Acked-by: Simon Glass <sjg@chromium.org>
2011-12-19 17:52:44 +01:00
3ea11cacdd arm, fdt: update ethernet mac address before booting Linux
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Gerald van Baren <gvb.uboot@gmail.com>
Acked-by: Wolfgang Denk <wd@denx.de>
2011-12-19 17:52:44 +01:00
9fd6826611 add print_cpuinfo to s3c24x0
Hello

This patch adds support for "print_cpuinfo" on Samsung s3c24x0
based targets. If activated by "#define CONFIG_DISPLAY_CPUINFO", the
chip ID and the 3 main cpu frequencies will be displayed.

Dave

Signed-off-by: David Müller <d.mueller@elsoft.ch>
2011-12-19 17:52:44 +01:00
df65a3fe35 omap4_panda: Initialize the USB phy
During misc_init_r, make sure to setup the clocks
properly for the USB hub on the pandaboard.  With
this in place, the USB hub and the ethernet works
on the pandaboard.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Acked-by: Aneesh V <aneesh@ti.com>
2011-12-19 17:52:44 +01:00
c005d6b193 davinci: Fixed wrong timebase clock frequency.
Signed-off-by: Manfred Rudigier <manfred.rudigier@omicron.at>
2011-12-19 17:52:43 +01:00
076cd49ad1 arm926ejs: remove noop flush_dcache_all function
Commit 2f3427c added noop cache functions implementation for arm926ejs
to fix compilation of drivers depending on these functions (DaVinci
EMAC in particular).

Unfortunately, the bug was introduced: noop implementation calls
dcache_disable which calls flush_dcache_all which in turn calls
dcache_disable thus creating an infinite loop.

This patch removes noop implementation for flush_dcache_all, we already
have default one in arch/arm/lib/cache.c and it should be used instead.

Signed-off-by: Ilya Yanok <yanok@emcraft.com>
Tested-by: Matthias Weisser <weisserm@arcor.de>
2011-12-19 17:52:43 +01:00
b539bedbf2 M28: Fix tab indent in u-boot.bd
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Detlev Zundel <dzu@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
2011-12-19 17:52:43 +01:00
60bae5ef82 Fix building for mx51evk board
Fix:
mx51evk.c:206:6: error: conflicting types for 'board_ehci_hcd_init'
/u-boot/include/usb/ehci-fsl.h:254:5: note: previous declaration of
'board_ehci_hcd_init' was here

We also fix board_ehci_hcd_init() for mx53loco board.
Building for mx53loco worked since <usb/ehci-fsl.h> is
not included here.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
2011-12-19 17:52:43 +01:00
34 changed files with 375 additions and 190 deletions

View File

@ -24,7 +24,7 @@
VERSION = 2011
PATCHLEVEL = 12
SUBLEVEL =
EXTRAVERSION = -rc2
EXTRAVERSION = -rc3
ifneq "$(SUBLEVEL)" ""
U_BOOT_VERSION = $(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
else
@ -643,7 +643,7 @@ unconfig:
sinclude $(obj).boards.depend
$(obj).boards.depend: boards.cfg
awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
@awk '(NF && $$1 !~ /^#/) { print $$1 ": " $$1 "_config; $$(MAKE)" }' $< > $@
#
# Functions to generate common board directory names

View File

@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
LIB = $(obj)lib$(SOC).o
COBJS-$(CONFIG_USE_IRQ) += interrupts.o
COBJS-$(CONFIG_DISPLAY_CPUINFO) += cpu_info.o
COBJS-y += speed.o
COBJS-y += timer.o
COBJS-y += usb.o

View File

@ -0,0 +1,54 @@
/*
* (C) Copyright 2010
* David Mueller <d.mueller@elsoft.ch>
*
* 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 <common.h>
#include <asm/io.h>
#include <asm/arch/s3c24x0_cpu.h>
typedef ulong (*getfreq)(void);
static const getfreq freq_f[] = {
get_FCLK,
get_HCLK,
get_PCLK,
};
static const char freq_c[] = { 'F', 'H', 'P' };
int print_cpuinfo(void)
{
int i;
char buf[32];
/* the S3C2400 seems to be lacking a CHIP ID register */
#ifndef CONFIG_S3C2400
ulong cpuid;
struct s3c24x0_gpio * const gpio = s3c24x0_get_base_gpio();
cpuid = readl(&gpio->gstatus1);
printf("CPUID: %8lX\n", cpuid);
#endif
for (i = 0; i < ARRAY_SIZE(freq_f); i++)
printf("%cCLK: %8s MHz\n", freq_c[i], strmhz(buf, freq_f[i]()));
return 0;
}

View File

@ -38,11 +38,6 @@ void invalidate_dcache_all(void)
dcache_noop();
}
void flush_dcache_all(void)
{
dcache_noop();
}
void invalidate_dcache_range(unsigned long start, unsigned long stop)
{
dcache_noop();

View File

@ -108,7 +108,7 @@ void __udelay(unsigned long usec)
*/
ulong get_tbclk(void)
{
return CONFIG_SYS_HZ;
return gd->timer_rate_hz;
}
#ifdef CONFIG_HW_WATCHDOG

View File

@ -132,6 +132,7 @@ reset:
orr r0, r0, #0xd3
msr cpsr,r0
#if !defined(CONFIG_TEGRA2)
/*
* Setup vector:
* (OMAP4 spl TEXT_BASE is not 32 byte aligned.
@ -147,6 +148,7 @@ reset:
ldr r0, =_start
mcr p15, 0, r0, c12, c0, 0 @Set VBAR
#endif
#endif /* !Tegra2 */
/* the mask ROM code should have PLL and others stable */
#ifndef CONFIG_SKIP_LOWLEVEL_INIT

View File

@ -470,6 +470,47 @@ struct omap4_prcm_regs {
};
struct omap4_scrm_regs {
u32 revision; /* 0x0000 */
u32 pad00[63];
u32 clksetuptime; /* 0x0100 */
u32 pmicsetuptime; /* 0x0104 */
u32 pad01[2];
u32 altclksrc; /* 0x0110 */
u32 pad02[2];
u32 c2cclkm; /* 0x011c */
u32 pad03[56];
u32 extclkreq; /* 0x0200 */
u32 accclkreq; /* 0x0204 */
u32 pwrreq; /* 0x0208 */
u32 pad04[1];
u32 auxclkreq0; /* 0x0210 */
u32 auxclkreq1; /* 0x0214 */
u32 auxclkreq2; /* 0x0218 */
u32 auxclkreq3; /* 0x021c */
u32 auxclkreq4; /* 0x0220 */
u32 auxclkreq5; /* 0x0224 */
u32 pad05[3];
u32 c2cclkreq; /* 0x0234 */
u32 pad06[54];
u32 auxclk0; /* 0x0310 */
u32 auxclk1; /* 0x0314 */
u32 auxclk2; /* 0x0318 */
u32 auxclk3; /* 0x031c */
u32 auxclk4; /* 0x0320 */
u32 auxclk5; /* 0x0324 */
u32 pad07[54];
u32 rsttime_reg; /* 0x0400 */
u32 pad08[6];
u32 c2crstctrl; /* 0x041c */
u32 extpwronrstctrl; /* 0x0420 */
u32 pad09[59];
u32 extwarmrstst_reg; /* 0x0510 */
u32 apewarmrstst_reg; /* 0x0514 */
u32 pad10[1];
u32 c2cwarmrstst_reg; /* 0x051C */
};
/* DPLL register offsets */
#define CM_CLKMODE_DPLL 0
#define CM_IDLEST_DPLL 0x4
@ -652,6 +693,28 @@ struct omap4_prcm_regs {
#define TPS62361_BASE_VOLT_MV 500
#define TPS62361_VSEL0_GPIO 7
/* AUXCLKx reg fields */
#define AUXCLK_ENABLE_MASK (1 << 8)
#define AUXCLK_SRCSELECT_SHIFT 1
#define AUXCLK_SRCSELECT_MASK (3 << 1)
#define AUXCLK_CLKDIV_SHIFT 16
#define AUXCLK_CLKDIV_MASK (0xF << 16)
#define AUXCLK_SRCSELECT_SYS_CLK 0
#define AUXCLK_SRCSELECT_CORE_DPLL 1
#define AUXCLK_SRCSELECT_PER_DPLL 2
#define AUXCLK_SRCSELECT_ALTERNATE 3
#define AUXCLK_CLKDIV_2 1
#define AUXCLK_CLKDIV_16 0xF
/* ALTCLKSRC */
#define ALTCLKSRC_MODE_MASK 3
#define ALTCLKSRC_ENABLE_INT_MASK 4
#define ALTCLKSRC_ENABLE_EXT_MASK 8
#define ALTCLKSRC_MODE_ACTIVE 1
/* Defines for DPLL setup */
#define DPLL_LOCKED_FREQ_TOLERANCE_0 0
#define DPLL_LOCKED_FREQ_TOLERANCE_500_KHZ 500

View File

@ -206,6 +206,8 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images)
fixup_memory_node(*of_flat_tree);
fdt_fixup_ethernet(*of_flat_tree);
fdt_initrd(*of_flat_tree, *initrd_start, *initrd_end, 1);
announce_and_cleanup();

View File

@ -107,7 +107,7 @@ static int set_interrupt_handler(unsigned int nr, void (*handler)(void),
return 0;
}
void timer_init(void)
int timer_init(void)
{
extern void timer_interrupt_handler(void);
u64 tmp;
@ -120,8 +120,9 @@ void timer_init(void)
tb_factor = (u32)tmp;
if (set_interrupt_handler(0, &timer_interrupt_handler, 3))
return;
return -EINVAL;
/* For all practical purposes, this gives us an overflow interrupt */
sysreg_write(COMPARE, 0xffffffff);
return 0;
}

View File

@ -152,7 +152,6 @@ int board_init(void)
/* Enable Ctrlc */
console_init_f();
gd->bd->bi_arch_number = MACH_TYPE_SBC35_A9G20;
/* adress of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;

View File

@ -86,11 +86,6 @@ int board_init(void)
/* Enable Ctrlc */
console_init_f();
#if defined(CONFIG_TNY_A9260)
gd->bd->bi_arch_number = MACH_TYPE_TNY_A9260;
#elif defined(CONFIG_TNY_A9G20)
gd->bd->bi_arch_number = MACH_TYPE_TNY_A9G20;
#endif
/* adress of boot parameters */
gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;

View File

@ -4,11 +4,11 @@ sources {
}
section (0) {
load u_boot_spl > 0x0000;
load ivt (entry = 0x0014) > 0x8000;
load u_boot_spl > 0x0000;
load ivt (entry = 0x0014) > 0x8000;
hab call 0x8000;
load u_boot > 0x40000100;
load ivt (entry = 0x40000100) > 0x8000;
load u_boot > 0x40000100;
load ivt (entry = 0x40000100) > 0x8000;
hab call 0x8000;
}

View File

@ -116,7 +116,7 @@ int misc_init_r (void)
eerev.etheraddr[5] = 0x4D;
/* cache config word for ELPPC */
*(int *) &eerev.res[0] = 0;
memset(&eerev.res[0], 0, 4);
initSrom = 1; /* force dialog */
copyNv = 1; /* copy to nvram */

View File

@ -422,7 +422,7 @@ static int mv64360_eth_real_open (struct eth_device *dev)
ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private;
unsigned int port_num;
u32 port_status, phy_reg_data;
u32 phy_reg_data;
ethernet_private = (ETH_PORT_INFO *) dev->priv;
/* ronen - when we update the MAC env params we only update dev->enetaddr
@ -520,7 +520,7 @@ static int mv64360_eth_real_open (struct eth_device *dev)
*/
MV_REG_WRITE (MV64360_ETH_MAXIMUM_TRANSMIT_UNIT (port_num), 0);
port_status = MV_REG_READ (MV64360_ETH_PORT_STATUS_REG (port_num));
MV_REG_READ (MV64360_ETH_PORT_STATUS_REG (port_num));
/* Check Link status on phy */
eth_port_read_smi_reg (port_num, 1, &phy_reg_data);
@ -638,15 +638,6 @@ static int mv64360_eth_free_rx_rings (struct eth_device *dev)
int mv64360_eth_stop (struct eth_device *dev)
{
ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private;
unsigned int port_num;
ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
/* Disable all gigE address decoder */
MV_REG_WRITE (MV64360_ETH_BASE_ADDR_ENABLE_REG, 0x3f);
DP (printf ("%s Ethernet stop called ... \n", __FUNCTION__));
@ -716,7 +707,6 @@ int mv64360_eth_xmit (struct eth_device *dev, volatile void *dataPtr,
{
ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private;
unsigned int port_num;
PKT_INFO pkt_info;
ETH_FUNC_RET_STATUS status;
struct net_device_stats *stats;
@ -725,7 +715,6 @@ int mv64360_eth_xmit (struct eth_device *dev, volatile void *dataPtr,
ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
stats = port_private->stats;
@ -801,7 +790,6 @@ int mv64360_eth_receive (struct eth_device *dev)
{
ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private;
unsigned int port_num;
PKT_INFO pkt_info;
struct net_device_stats *stats;
@ -809,7 +797,6 @@ int mv64360_eth_receive (struct eth_device *dev)
ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
stats = port_private->stats;
while ((eth_port_receive (ethernet_private, ETH_Q0, &pkt_info) ==
@ -900,12 +887,10 @@ static struct net_device_stats *mv64360_eth_get_stats (struct eth_device *dev)
{
ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private;
unsigned int port_num;
ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
mv64360_eth_update_stat (dev);
@ -927,13 +912,10 @@ static void mv64360_eth_update_stat (struct eth_device *dev)
ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private;
struct net_device_stats *stats;
unsigned int port_num;
volatile unsigned int dummy;
ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
stats = port_private->stats;
/* These are false updates */
@ -956,12 +938,12 @@ static void mv64360_eth_update_stat (struct eth_device *dev)
* But the unsigned long in PowerPC and MIPS are 32bit. So the next read
* is just a dummy read for proper work of the GigE port
*/
dummy = eth_read_mib_counter (ethernet_private->port_num,
(void)eth_read_mib_counter (ethernet_private->port_num,
ETH_MIB_GOOD_OCTETS_RECEIVED_HIGH);
stats->tx_bytes += (unsigned long)
eth_read_mib_counter (ethernet_private->port_num,
ETH_MIB_GOOD_OCTETS_SENT_LOW);
dummy = eth_read_mib_counter (ethernet_private->port_num,
(void)eth_read_mib_counter (ethernet_private->port_num,
ETH_MIB_GOOD_OCTETS_SENT_HIGH);
stats->rx_errors += (unsigned long)
eth_read_mib_counter (ethernet_private->port_num,
@ -1009,12 +991,10 @@ static void mv64360_eth_print_stat (struct eth_device *dev)
ETH_PORT_INFO *ethernet_private;
struct mv64360_eth_priv *port_private;
struct net_device_stats *stats;
unsigned int port_num;
ethernet_private = (ETH_PORT_INFO *) dev->priv;
port_private =
(struct mv64360_eth_priv *) ethernet_private->port_private;
port_num = port_private->port_num;
stats = port_private->stats;
/* These are false updates */
@ -2066,13 +2046,13 @@ static void eth_port_init_mac_tables (ETH_PORT eth_port_num)
static void eth_clear_mib_counters (ETH_PORT eth_port_num)
{
int i;
unsigned int dummy;
/* Perform dummy reads from MIB counters */
for (i = ETH_MIB_GOOD_OCTETS_RECEIVED_LOW; i < ETH_MIB_LATE_COLLISION;
i += 4)
dummy = MV_REG_READ ((MV64360_ETH_MIB_COUNTERS_BASE
i += 4) {
(void)MV_REG_READ ((MV64360_ETH_MIB_COUNTERS_BASE
(eth_port_num) + i));
}
return;
}

View File

@ -203,7 +203,7 @@ static void setup_usb_h1(void)
mxc_iomux_set_pad(MX51_PIN_EIM_D21, GPIO_PAD);
}
void board_ehci_hcd_init(int port)
int board_ehci_hcd_init(int port)
{
/* Set USBH1_STP to GPIO and toggle it */
mxc_request_iomux(MX51_PIN_USBH1_STP, IOMUX_CONFIG_GPIO);
@ -228,6 +228,7 @@ void board_ehci_hcd_init(int port)
gpio_direction_output(MX51EVK_USBH1_HUB_RST, 0);
mdelay(2);
gpio_set_value(MX51EVK_USBH1_HUB_RST, 1);
return 0;
}
#endif

View File

@ -79,12 +79,13 @@ static void setup_iomux_uart(void)
}
#ifdef CONFIG_USB_EHCI_MX5
void board_ehci_hcd_init(int port)
int board_ehci_hcd_init(int port)
{
/* request VBUS power enable pin, GPIO[8}, gpio7 */
mxc_request_iomux(MX53_PIN_ATA_DA_2, IOMUX_CONFIG_ALT1);
gpio_direction_output(IOMUX_TO_GPIO(MX53_PIN_ATA_DA_2), 0);
gpio_set_value(IOMUX_TO_GPIO(MX53_PIN_ATA_DA_2), 1);
return 0;
}
#endif

View File

@ -7,7 +7,7 @@ default environment must be parsed:
run develop : setup environment to configure for rootfs via nfs
run ramfs : setup environment to configure for rootfs in ram
Last change: 20.05.2011
Last change: 24.11.2011
develop-common.txt
============================

View File

@ -2,6 +2,7 @@ altbootcmd=run ${subbootcmds}
bootcmd=run ${subbootcmds}
configure=km_setboardid && saveenv && reset
subbootcmds=tftpfdt tftpkernel nfsargs add_default boot
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:/opt/eldk/${arch}
nfsargs=setenv bootargs root=/dev/nfs rw nfsroot=${serverip}:${toolchain}/${arch}
tftpkernel=tftpboot ${load_addr_r} ${hostname}/uImage
toolchain=/opt/eldk
rootfssize=0

View File

@ -28,6 +28,8 @@
#include <common.h>
#include <netdev.h>
#include <asm/arch/pxa.h>
#include <asm/arch/pxa-regs.h>
#include <asm/io.h>
DECLARE_GLOBAL_DATA_PTR;
@ -47,6 +49,10 @@ int board_init (void)
/* adress of boot parameters */
gd->bd->bi_boot_params = 0xa0000100;
/* Configure GPIO6 and GPIO8 as OUT, AF1. */
setbits_le32(GPDR0, (1 << 6) | (1 << 8));
clrsetbits_le32(GAFR0_L, (3 << 12) | (3 << 16), (1 << 12) | (1 << 16));
return 0;
}

View File

@ -260,7 +260,7 @@ int board_mmc_init(bd_t *bis)
#ifdef CONFIG_USB_GADGET
static int s5pc210_phy_control(int on)
{
int ret;
int ret = 0;
struct pmic *p = get_pmic();
if (pmic_probe(p))

View File

@ -24,15 +24,21 @@
#include <common.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/mmc_host_def.h>
#include <asm/arch/clocks.h>
#include <asm/arch/gpio.h>
#include "panda_mux_data.h"
#define PANDA_ULPI_PHY_TYPE_GPIO 182
DECLARE_GLOBAL_DATA_PTR;
const struct omap_sysinfo sysinfo = {
"Board: OMAP4 Panda\n"
};
struct omap4_scrm_regs *const scrm = (struct omap4_scrm_regs *)0x4a30a000;
/**
* @brief board_init
*
@ -62,6 +68,59 @@ int board_eth_init(bd_t *bis)
*/
int misc_init_r(void)
{
int phy_type;
u32 auxclk, altclksrc;
/* EHCI is not supported on ES1.0 */
if (omap_revision() == OMAP4430_ES1_0)
return 0;
gpio_direction_input(PANDA_ULPI_PHY_TYPE_GPIO);
phy_type = gpio_get_value(PANDA_ULPI_PHY_TYPE_GPIO);
if (phy_type == 1) {
/* ULPI PHY supplied by auxclk3 derived from sys_clk */
debug("ULPI PHY supplied by auxclk3\n");
auxclk = readl(&scrm->auxclk3);
/* Select sys_clk */
auxclk &= ~AUXCLK_SRCSELECT_MASK;
auxclk |= AUXCLK_SRCSELECT_SYS_CLK << AUXCLK_SRCSELECT_SHIFT;
/* Set the divisor to 2 */
auxclk &= ~AUXCLK_CLKDIV_MASK;
auxclk |= AUXCLK_CLKDIV_2 << AUXCLK_CLKDIV_SHIFT;
/* Request auxilary clock #3 */
auxclk |= AUXCLK_ENABLE_MASK;
writel(auxclk, &scrm->auxclk3);
} else {
/* ULPI PHY supplied by auxclk1 derived from PER dpll */
debug("ULPI PHY supplied by auxclk1\n");
auxclk = readl(&scrm->auxclk1);
/* Select per DPLL */
auxclk &= ~AUXCLK_SRCSELECT_MASK;
auxclk |= AUXCLK_SRCSELECT_PER_DPLL << AUXCLK_SRCSELECT_SHIFT;
/* Set the divisor to 16 */
auxclk &= ~AUXCLK_CLKDIV_MASK;
auxclk |= AUXCLK_CLKDIV_16 << AUXCLK_CLKDIV_SHIFT;
/* Request auxilary clock #3 */
auxclk |= AUXCLK_ENABLE_MASK;
writel(auxclk, &scrm->auxclk1);
}
altclksrc = readl(&scrm->altclksrc);
/* Activate alternate system clock supplier */
altclksrc &= ~ALTCLKSRC_MODE_MASK;
altclksrc |= ALTCLKSRC_MODE_ACTIVE;
/* enable clocks */
altclksrc |= ALTCLKSRC_ENABLE_INT_MASK | ALTCLKSRC_ENABLE_EXT_MASK;
writel(altclksrc, &scrm->altclksrc);
return 0;
}

View File

@ -221,8 +221,11 @@ static int netboot_common(enum proto_t proto, cmd_tbl_t *cmdtp, int argc,
#ifdef CONFIG_CMD_TFTPPUT
case 4:
save_addr = strict_strtoul(argv[1], NULL, 16);
save_size = strict_strtoul(argv[2], NULL, 16);
if (strict_strtoul(argv[1], 16, &save_addr) < 0 ||
strict_strtoul(argv[2], 16, &save_size) < 0) {
printf("Invalid address/size\n");
return cmd_usage(cmdtp);
}
copy_filename(BootFile, argv[3], sizeof(BootFile));
break;
#endif

View File

@ -918,7 +918,7 @@ static int parse_menu(char **c, struct pxe_menu *cfg, char *b, int nest_level)
{
struct token t;
char *s = *c;
int err;
int err = 0;
get_token(c, &t, L_KEYWORD);

View File

@ -9,13 +9,13 @@ mkimage \- Generate image for U-Boot
The
.B mkimage
command is used to create images for use with the U-Boot boot loader.
Thes eimages can contain the linux kernel, device tree blob, root file
These images can contain the linux kernel, device tree blob, root file
system image, firmware images etc., either separate or combined.
.B mkimage
supports two different formats:
The old,
The old
.I legacy image
format concatenates the individual parts (for example, kernel image,
device tree blob and ramdisk image) and adds a 64 bytes header
@ -23,9 +23,9 @@ containing information about target architecture, operating system,
image type, compression method, entry points, time stamp, checksums,
etc.
The new,
The new
.I FIT (Flattened Image Tree) format
allows for more flexibility in handling images of various and also
allows for more flexibility in handling images of various types and also
enhances integrity protection of images with stronger checksums.
.SH "OPTIONS"
@ -88,10 +88,10 @@ create the image.
.TP
.BI "\-f "fit-image.its"
Image tree source fine that descbres the structure and contents of the
Image tree source file that describes the structure and contents of the
FIT image.
.SH EXMAPLES
.SH EXAMPLES
List image information:
.nf

View File

@ -560,11 +560,6 @@ mmc_legacy_init(int verbose)
/* Reset device interface type */
mmc_dev.if_type = IF_TYPE_UNKNOWN;
#if defined(CONFIG_LUBBOCK) || \
(defined(CONFIG_GUMSTIX) && !defined(CONFIG_CPU_PXA27X))
set_GPIO_mode(GPIO6_MMCCLK_MD);
set_GPIO_mode(GPIO8_MMCCS0_MD);
#endif
#ifdef CONFIG_CPU_MONAHANS /* pxa3xx */
writel(readl(CKENA) | CKENA_12_MMC0 | CKENA_13_MMC1, CKENA);
#else /* pxa2xx */

View File

@ -1146,7 +1146,7 @@ e1000_read_mac_addr(struct eth_device *nic)
nic->enetaddr[5] ^= 1;
#ifdef CONFIG_E1000_FALLBACK_MAC
if ( *(u32*)(nic->enetaddr) == 0 || *(u32*)(nic->enetaddr) == ~0 ) {
if (!is_valid_ether_addr(nic->enetaddr)) {
unsigned char fb_mac[NODE_ADDRESS_SIZE] = CONFIG_E1000_FALLBACK_MAC;
memcpy (nic->enetaddr, fb_mac, NODE_ADDRESS_SIZE);

View File

@ -1,4 +1,5 @@
#include "e1000.h"
#include <linux/compiler.h>
/*-----------------------------------------------------------------------
* SPI transfer
@ -112,7 +113,7 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
void spi_free_slave(struct spi_slave *spi)
{
struct e1000_hw *hw = e1000_hw_from_spi(spi);
__maybe_unused struct e1000_hw *hw = e1000_hw_from_spi(spi);
E1000_DBG(hw->nic, "EEPROM SPI access released\n");
}
@ -469,7 +470,7 @@ static int do_e1000_spi_program(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
static int do_e1000_spi_checksum(cmd_tbl_t *cmdtp, struct e1000_hw *hw,
int argc, char * const argv[])
{
uint16_t i, length, checksum, checksum_reg;
uint16_t i, length, checksum = 0, checksum_reg;
uint16_t *buffer;
boolean_t upd;

View File

@ -47,7 +47,6 @@
#include <asm/arch/gpio.h>
#include "regs-otg.h"
#include <usb/s3c_udc.h>
#include <usb/lin_gadget_compat.h>
/***********************************************************/
@ -73,8 +72,6 @@
#define EP0_CON 0
#define EP_MASK 0xF
#if defined(DEBUG_S3C_UDC_SETUP) || defined(DEBUG_S3C_UDC_ISR) \
|| defined(DEBUG_S3C_UDC_OUT_EP)
static char *state_names[] = {
"WAIT_FOR_SETUP",
"DATA_STATE_XMIT",
@ -86,7 +83,6 @@ static char *state_names[] = {
"WAIT_FOR_IN_COMPLETE",
"WAIT_FOR_NULL_COMPLETE",
};
#endif
#define DRIVER_DESC "S3C HS USB OTG Device Driver, (c) Samsung Electronics"
#define DRIVER_VERSION "15 March 2009"
@ -362,7 +358,7 @@ static void done(struct s3c_ep *ep, struct s3c_request *req, int status)
{
unsigned int stopped = ep->stopped;
DEBUG("%s: %s %p, req = %p, stopped = %d\n",
debug("%s: %s %p, req = %p, stopped = %d\n",
__func__, ep->ep.name, ep, &req->req, stopped);
list_del_init(&req->queue);
@ -373,7 +369,7 @@ static void done(struct s3c_ep *ep, struct s3c_request *req, int status)
status = req->req.status;
if (status && status != -ESHUTDOWN) {
DEBUG("complete %s req %p stat %d len %u/%u\n",
debug("complete %s req %p stat %d len %u/%u\n",
ep->ep.name, &req->req, status,
req->req.actual, req->req.length);
}
@ -401,7 +397,7 @@ static void done(struct s3c_ep *ep, struct s3c_request *req, int status)
req->req.complete(&ep->ep, &req->req);
spin_lock(&ep->dev->lock);
DEBUG("callback completed\n");
debug("callback completed\n");
ep->stopped = stopped;
}
@ -413,7 +409,7 @@ static void nuke(struct s3c_ep *ep, int status)
{
struct s3c_request *req;
DEBUG("%s: %s %p\n", __func__, ep->ep.name, ep);
debug("%s: %s %p\n", __func__, ep->ep.name, ep);
/* called with irqs blocked */
while (!list_empty(&ep->queue)) {
@ -456,7 +452,7 @@ static void reconfig_usbd(void)
int i;
unsigned int uTemp = writel(CORE_SOFT_RESET, &reg->grstctl);
DEBUG(2, "Reseting OTG controller\n");
debug("Reseting OTG controller\n");
writel(0<<15 /* PHY Low Power Clock sel*/
|1<<14 /* Non-Periodic TxFIFO Rewind Enable*/
@ -526,13 +522,13 @@ static void reconfig_usbd(void)
/* Flush the RX FIFO */
writel(RX_FIFO_FLUSH, &reg->grstctl);
while (readl(&reg->grstctl) & RX_FIFO_FLUSH)
DEBUG("%s: waiting for S3C_UDC_OTG_GRSTCTL\n", __func__);
debug("%s: waiting for S3C_UDC_OTG_GRSTCTL\n", __func__);
/* Flush all the Tx FIFO's */
writel(TX_FIFO_FLUSH_ALL, &reg->grstctl);
writel(TX_FIFO_FLUSH_ALL | TX_FIFO_FLUSH, &reg->grstctl);
while (readl(&reg->grstctl) & TX_FIFO_FLUSH)
DEBUG("%s: waiting for S3C_UDC_OTG_GRSTCTL\n", __func__);
debug("%s: waiting for S3C_UDC_OTG_GRSTCTL\n", __func__);
/* 13. Clear NAK bit of EP0, EP1, EP2*/
/* For Slave mode*/
@ -581,7 +577,7 @@ static int s3c_ep_enable(struct usb_ep *_ep,
struct s3c_udc *dev;
unsigned long flags;
DEBUG("%s: %p\n", __func__, _ep);
debug("%s: %p\n", __func__, _ep);
ep = container_of(_ep, struct s3c_ep, ep);
if (!_ep || !desc || ep->desc || _ep->name == ep0name
@ -590,7 +586,7 @@ static int s3c_ep_enable(struct usb_ep *_ep,
|| ep_maxpacket(ep) <
le16_to_cpu(get_unaligned(&desc->wMaxPacketSize))) {
DEBUG("%s: bad ep or descriptor\n", __func__);
debug("%s: bad ep or descriptor\n", __func__);
return -EINVAL;
}
@ -599,7 +595,7 @@ static int s3c_ep_enable(struct usb_ep *_ep,
&& ep->bmAttributes != USB_ENDPOINT_XFER_BULK
&& desc->bmAttributes != USB_ENDPOINT_XFER_INT) {
DEBUG("%s: %s type mismatch\n", __func__, _ep->name);
debug("%s: %s type mismatch\n", __func__, _ep->name);
return -EINVAL;
}
@ -608,14 +604,14 @@ static int s3c_ep_enable(struct usb_ep *_ep,
&& le16_to_cpu(get_unaligned(&desc->wMaxPacketSize)) !=
ep_maxpacket(ep)) || !get_unaligned(&desc->wMaxPacketSize)) {
DEBUG("%s: bad %s maxpacket\n", __func__, _ep->name);
debug("%s: bad %s maxpacket\n", __func__, _ep->name);
return -ERANGE;
}
dev = ep->dev;
if (!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN) {
DEBUG("%s: bogus device state\n", __func__);
debug("%s: bogus device state\n", __func__);
return -ESHUTDOWN;
}
@ -632,7 +628,7 @@ static int s3c_ep_enable(struct usb_ep *_ep,
s3c_udc_ep_activate(ep);
spin_unlock_irqrestore(&ep->dev->lock, flags);
DEBUG("%s: enabled %s, stopped = %d, maxpacket = %d\n",
debug("%s: enabled %s, stopped = %d, maxpacket = %d\n",
__func__, _ep->name, ep->stopped, ep->ep.maxpacket);
return 0;
}
@ -645,11 +641,11 @@ static int s3c_ep_disable(struct usb_ep *_ep)
struct s3c_ep *ep;
unsigned long flags;
DEBUG("%s: %p\n", __func__, _ep);
debug("%s: %p\n", __func__, _ep);
ep = container_of(_ep, struct s3c_ep, ep);
if (!_ep || !ep->desc) {
DEBUG("%s: %s not enabled\n", __func__,
debug("%s: %s not enabled\n", __func__,
_ep ? ep->ep.name : NULL);
return -EINVAL;
}
@ -664,7 +660,7 @@ static int s3c_ep_disable(struct usb_ep *_ep)
spin_unlock_irqrestore(&ep->dev->lock, flags);
DEBUG("%s: disabled %s\n", __func__, _ep->name);
debug("%s: disabled %s\n", __func__, _ep->name);
return 0;
}
@ -673,7 +669,7 @@ static struct usb_request *s3c_alloc_request(struct usb_ep *ep,
{
struct s3c_request *req;
DEBUG("%s: %s %p\n", __func__, ep->name, ep);
debug("%s: %s %p\n", __func__, ep->name, ep);
req = kmalloc(sizeof *req, gfp_flags);
if (!req)
@ -689,7 +685,7 @@ static void s3c_free_request(struct usb_ep *ep, struct usb_request *_req)
{
struct s3c_request *req;
DEBUG("%s: %p\n", __func__, ep);
debug("%s: %p\n", __func__, ep);
req = container_of(_req, struct s3c_request, req);
WARN_ON(!list_empty(&req->queue));
@ -703,7 +699,7 @@ static int s3c_dequeue(struct usb_ep *_ep, struct usb_request *_req)
struct s3c_request *req;
unsigned long flags;
DEBUG("%s: %p\n", __func__, _ep);
debug("%s: %p\n", __func__, _ep);
ep = container_of(_ep, struct s3c_ep, ep);
if (!_ep || ep->ep.name == ep0name)
@ -737,11 +733,11 @@ static int s3c_fifo_status(struct usb_ep *_ep)
ep = container_of(_ep, struct s3c_ep, ep);
if (!_ep) {
DEBUG("%s: bad ep\n", __func__);
debug("%s: bad ep\n", __func__);
return -ENODEV;
}
DEBUG("%s: %d\n", __func__, ep_index(ep));
debug("%s: %d\n", __func__, ep_index(ep));
/* LPD can't report unclaimed bytes from IN fifos */
if (ep_is_in(ep))
@ -759,11 +755,11 @@ static void s3c_fifo_flush(struct usb_ep *_ep)
ep = container_of(_ep, struct s3c_ep, ep);
if (unlikely(!_ep || (!ep->desc && ep->ep.name != ep0name))) {
DEBUG("%s: bad ep\n", __func__);
debug("%s: bad ep\n", __func__);
return;
}
DEBUG("%s: %d\n", __func__, ep_index(ep));
debug("%s: %d\n", __func__, ep_index(ep));
}
static const struct usb_gadget_ops s3c_udc_ops = {
@ -849,7 +845,7 @@ int s3c_udc_probe(struct s3c_plat_otg_data *pdata)
struct s3c_udc *dev = &memory;
int retval = 0, i;
DEBUG("%s: %p\n", __func__, pdata);
debug("%s: %p\n", __func__, pdata);
dev->pdata = pdata;

View File

@ -62,7 +62,7 @@ void s3c_udc_pre_setup(void)
{
u32 ep_ctrl;
DEBUG_IN_EP("%s : Prepare Setup packets.\n", __func__);
debug_cond(DEBUG_IN_EP, "%s : Prepare Setup packets.\n", __func__);
invalidate_dcache_range((unsigned long) usb_ctrl_dma_addr,
(unsigned long) usb_ctrl_dma_addr
@ -91,7 +91,8 @@ static inline void s3c_ep0_complete_out(void)
DEBUG_EP0("%s:EP0 ZLP DOEPCTL0 = 0x%x\n",
__func__, readl(&reg->out_endp[EP0_CON].doepctl));
DEBUG_IN_EP("%s : Prepare Complete Out packet.\n", __func__);
debug_cond(DEBUG_IN_EP,
"%s : Prepare Complete Out packet.\n", __func__);
invalidate_dcache_range((unsigned long) usb_ctrl_dma_addr,
(unsigned long) usb_ctrl_dma_addr
@ -203,14 +204,15 @@ int setdma_tx(struct s3c_ep *ep, struct s3c_request *req)
writel(DEPCTL_EPENA|DEPCTL_CNAK|ctrl, &reg->in_endp[ep_num].diepctl);
DEBUG_IN_EP("%s:EP%d TX DMA start : DIEPDMA0 = 0x%x,"
"DIEPTSIZ0 = 0x%x, DIEPCTL0 = 0x%x\n"
"\tbuf = 0x%p, pktcnt = %d, xfersize = %d\n",
__func__, ep_num,
readl(&reg->in_endp[ep_num].diepdma),
readl(&reg->in_endp[ep_num].dieptsiz),
readl(&reg->in_endp[ep_num].diepctl),
buf, pktcnt, length);
debug_cond(DEBUG_IN_EP,
"%s:EP%d TX DMA start : DIEPDMA0 = 0x%x,"
"DIEPTSIZ0 = 0x%x, DIEPCTL0 = 0x%x\n"
"\tbuf = 0x%p, pktcnt = %d, xfersize = %d\n",
__func__, ep_num,
readl(&reg->in_endp[ep_num].diepdma),
readl(&reg->in_endp[ep_num].dieptsiz),
readl(&reg->in_endp[ep_num].diepctl),
buf, pktcnt, length);
return length;
}
@ -287,8 +289,9 @@ static void complete_tx(struct s3c_udc *dev, u8 ep_num)
}
if (list_empty(&ep->queue)) {
DEBUG_IN_EP("%s: TX DMA done : NULL REQ on IN EP-%d\n",
__func__, ep_num);
debug_cond(DEBUG_IN_EP,
"%s: TX DMA done : NULL REQ on IN EP-%d\n",
__func__, ep_num);
return;
}
@ -301,33 +304,38 @@ static void complete_tx(struct s3c_udc *dev, u8 ep_num)
is_short = (xfer_size < ep->ep.maxpacket);
req->req.actual += min(xfer_size, req->req.length - req->req.actual);
DEBUG_IN_EP("%s: TX DMA done : ep = %d, tx bytes = %d/%d, "
"is_short = %d, DIEPTSIZ = 0x%x, remained bytes = %d\n",
__func__, ep_num, req->req.actual, req->req.length,
is_short, ep_tsr, xfer_size);
debug_cond(DEBUG_IN_EP,
"%s: TX DMA done : ep = %d, tx bytes = %d/%d, "
"is_short = %d, DIEPTSIZ = 0x%x, remained bytes = %d\n",
__func__, ep_num, req->req.actual, req->req.length,
is_short, ep_tsr, xfer_size);
if (ep_num == 0) {
if (dev->ep0state == DATA_STATE_XMIT) {
DEBUG_IN_EP("%s: ep_num = %d, ep0stat =="
"DATA_STATE_XMIT\n",
__func__, ep_num);
debug_cond(DEBUG_IN_EP,
"%s: ep_num = %d, ep0stat =="
"DATA_STATE_XMIT\n",
__func__, ep_num);
last = write_fifo_ep0(ep, req);
if (last)
dev->ep0state = WAIT_FOR_COMPLETE;
} else if (dev->ep0state == WAIT_FOR_IN_COMPLETE) {
DEBUG_IN_EP("%s: ep_num = %d, completing request\n",
__func__, ep_num);
debug_cond(DEBUG_IN_EP,
"%s: ep_num = %d, completing request\n",
__func__, ep_num);
done(ep, req, 0);
dev->ep0state = WAIT_FOR_SETUP;
} else if (dev->ep0state == WAIT_FOR_COMPLETE) {
DEBUG_IN_EP("%s: ep_num = %d, completing request\n",
__func__, ep_num);
debug_cond(DEBUG_IN_EP,
"%s: ep_num = %d, completing request\n",
__func__, ep_num);
done(ep, req, 0);
dev->ep0state = WAIT_FOR_OUT_COMPLETE;
s3c_ep0_complete_out();
} else {
DEBUG_IN_EP("%s: ep_num = %d, invalid ep state\n",
__func__, ep_num);
debug_cond(DEBUG_IN_EP,
"%s: ep_num = %d, invalid ep state\n",
__func__, ep_num);
}
return;
}
@ -337,7 +345,8 @@ static void complete_tx(struct s3c_udc *dev, u8 ep_num)
if (!list_empty(&ep->queue)) {
req = list_entry(ep->queue.next, struct s3c_request, queue);
DEBUG_IN_EP("%s: Next Tx request start...\n", __func__);
debug_cond(DEBUG_IN_EP,
"%s: Next Tx request start...\n", __func__);
setdma_tx(ep, req);
}
}
@ -347,19 +356,22 @@ static inline void s3c_udc_check_tx_queue(struct s3c_udc *dev, u8 ep_num)
struct s3c_ep *ep = &dev->ep[ep_num];
struct s3c_request *req;
DEBUG_IN_EP("%s: Check queue, ep_num = %d\n", __func__, ep_num);
debug_cond(DEBUG_IN_EP,
"%s: Check queue, ep_num = %d\n", __func__, ep_num);
if (!list_empty(&ep->queue)) {
req = list_entry(ep->queue.next, struct s3c_request, queue);
DEBUG_IN_EP("%s: Next Tx request(0x%p) start...\n",
__func__, req);
debug_cond(DEBUG_IN_EP,
"%s: Next Tx request(0x%p) start...\n",
__func__, req);
if (ep_is_in(ep))
setdma_tx(ep, req);
else
setdma_rx(ep, req);
} else {
DEBUG_IN_EP("%s: NULL REQ on IN EP-%d\n", __func__, ep_num);
debug_cond(DEBUG_IN_EP,
"%s: NULL REQ on IN EP-%d\n", __func__, ep_num);
return;
}
@ -372,15 +384,15 @@ static void process_ep_in_intr(struct s3c_udc *dev)
u8 ep_num = 0;
ep_intr = readl(&reg->daint);
DEBUG_IN_EP("*** %s: EP In interrupt : DAINT = 0x%x\n",
__func__, ep_intr);
debug_cond(DEBUG_IN_EP,
"*** %s: EP In interrupt : DAINT = 0x%x\n", __func__, ep_intr);
ep_intr &= DAINT_MASK;
while (ep_intr) {
if (ep_intr & DAINT_IN_EP_INT(1)) {
ep_intr_status = readl(&reg->in_endp[ep_num].diepint);
DEBUG_IN_EP("\tEP%d-IN : DIEPINT = 0x%x\n",
debug_cond(DEBUG_IN_EP, "\tEP%d-IN : DIEPINT = 0x%x\n",
ep_num, ep_intr_status);
/* Interrupt Clear */
@ -473,7 +485,8 @@ static int s3c_udc_irq(int irq, void *_dev)
intr_status = readl(&reg->gintsts);
gintmsk = readl(&reg->gintmsk);
DEBUG_ISR("\n*** %s : GINTSTS=0x%x(on state %s), GINTMSK : 0x%x,"
debug_cond(DEBUG_ISR,
"\n*** %s : GINTSTS=0x%x(on state %s), GINTMSK : 0x%x,"
"DAINT : 0x%x, DAINTMSK : 0x%x\n",
__func__, intr_status, state_names[dev->ep0state], gintmsk,
readl(&reg->daint), readl(&reg->daintmsk));
@ -484,30 +497,32 @@ static int s3c_udc_irq(int irq, void *_dev)
}
if (intr_status & INT_ENUMDONE) {
DEBUG_ISR("\tSpeed Detection interrupt\n");
debug_cond(DEBUG_ISR, "\tSpeed Detection interrupt\n");
writel(INT_ENUMDONE, &reg->gintsts);
usb_status = (readl(&reg->dsts) & 0x6);
if (usb_status & (USB_FULL_30_60MHZ | USB_FULL_48MHZ)) {
DEBUG_ISR("\t\tFull Speed Detection\n");
debug_cond(DEBUG_ISR, "\t\tFull Speed Detection\n");
set_max_pktsize(dev, USB_SPEED_FULL);
} else {
DEBUG_ISR("\t\tHigh Speed Detection : 0x%x\n",
usb_status);
debug_cond(DEBUG_ISR,
"\t\tHigh Speed Detection : 0x%x\n",
usb_status);
set_max_pktsize(dev, USB_SPEED_HIGH);
}
}
if (intr_status & INT_EARLY_SUSPEND) {
DEBUG_ISR("\tEarly suspend interrupt\n");
debug_cond(DEBUG_ISR, "\tEarly suspend interrupt\n");
writel(INT_EARLY_SUSPEND, &reg->gintsts);
}
if (intr_status & INT_SUSPEND) {
usb_status = readl(&reg->dsts);
DEBUG_ISR("\tSuspend interrupt :(DSTS):0x%x\n", usb_status);
debug_cond(DEBUG_ISR,
"\tSuspend interrupt :(DSTS):0x%x\n", usb_status);
writel(INT_SUSPEND, &reg->gintsts);
if (dev->gadget.speed != USB_SPEED_UNKNOWN
@ -525,7 +540,7 @@ static int s3c_udc_irq(int irq, void *_dev)
}
if (intr_status & INT_RESUME) {
DEBUG_ISR("\tResume interrupt\n");
debug_cond(DEBUG_ISR, "\tResume interrupt\n");
writel(INT_RESUME, &reg->gintsts);
if (dev->gadget.speed != USB_SPEED_UNKNOWN
@ -538,13 +553,15 @@ static int s3c_udc_irq(int irq, void *_dev)
if (intr_status & INT_RESET) {
usb_status = readl(&reg->gotgctl);
DEBUG_ISR("\tReset interrupt - (GOTGCTL):0x%x\n", usb_status);
debug_cond(DEBUG_ISR,
"\tReset interrupt - (GOTGCTL):0x%x\n", usb_status);
writel(INT_RESET, &reg->gintsts);
if ((usb_status & 0xc0000) == (0x3 << 18)) {
if (reset_available) {
DEBUG_ISR("\t\tOTG core got reset (%d)!!\n",
reset_available);
debug_cond(DEBUG_ISR,
"\t\tOTG core got reset (%d)!!\n",
reset_available);
reconfig_usbd();
dev->ep0state = WAIT_FOR_SETUP;
reset_available = 0;
@ -554,7 +571,7 @@ static int s3c_udc_irq(int irq, void *_dev)
} else {
reset_available = 1;
DEBUG_ISR("\t\tRESET handling skipped\n");
debug_cond(DEBUG_ISR, "\t\tRESET handling skipped\n");
}
}
@ -585,7 +602,7 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req,
if (unlikely(!_req || !_req->complete || !_req->buf
|| !list_empty(&req->queue))) {
DEBUG("%s: bad params\n", __func__);
debug("%s: bad params\n", __func__);
return -EINVAL;
}
@ -593,7 +610,7 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req,
if (unlikely(!_ep || (!ep->desc && ep->ep.name != ep0name))) {
DEBUG("%s: bad ep: %s, %d, %x\n", __func__,
debug("%s: bad ep: %s, %d, %p\n", __func__,
ep->ep.name, !ep->desc, _ep);
return -EINVAL;
}
@ -602,7 +619,7 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req,
dev = ep->dev;
if (unlikely(!dev->driver || dev->gadget.speed == USB_SPEED_UNKNOWN)) {
DEBUG("%s: bogus device state %p\n", __func__, dev->driver);
debug("%s: bogus device state %p\n", __func__, dev->driver);
return -ESHUTDOWN;
}
@ -612,7 +629,7 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req,
_req->actual = 0;
/* kickstart this i/o queue? */
DEBUG("\n*** %s: %s-%s req = %p, len = %d, buf = %p"
debug("\n*** %s: %s-%s req = %p, len = %d, buf = %p"
"Q empty = %d, stopped = %d\n",
__func__, _ep->name, ep_is_in(ep) ? "in" : "out",
_req, _req->length, _req->buf,
@ -644,8 +661,9 @@ static int s3c_queue(struct usb_ep *_ep, struct usb_request *_req,
} else if (ep_is_in(ep)) {
gintsts = readl(&reg->gintsts);
DEBUG_IN_EP("%s: ep_is_in, S3C_UDC_OTG_GINTSTS=0x%x\n",
__func__, gintsts);
debug_cond(DEBUG_IN_EP,
"%s: ep_is_in, S3C_UDC_OTG_GINTSTS=0x%x\n",
__func__, gintsts);
setdma_tx(ep, req);
} else {
@ -775,13 +793,12 @@ static void s3c_ep0_read(struct s3c_udc *dev)
{
struct s3c_request *req;
struct s3c_ep *ep = &dev->ep[0];
int ret;
if (!list_empty(&ep->queue)) {
req = list_entry(ep->queue.next, struct s3c_request, queue);
} else {
DEBUG("%s: ---> BUG\n", __func__);
debug("%s: ---> BUG\n", __func__);
BUG();
return;
}
@ -801,7 +818,7 @@ static void s3c_ep0_read(struct s3c_udc *dev)
return;
}
ret = setdma_rx(ep, req);
setdma_rx(ep, req);
}
/*
@ -910,19 +927,19 @@ static void s3c_udc_set_nak(struct s3c_ep *ep)
u32 ep_ctrl = 0;
ep_num = ep_index(ep);
DEBUG("%s: ep_num = %d, ep_type = %d\n", __func__, ep_num, ep->ep_type);
debug("%s: ep_num = %d, ep_type = %d\n", __func__, ep_num, ep->ep_type);
if (ep_is_in(ep)) {
ep_ctrl = readl(&reg->in_endp[ep_num].diepctl);
ep_ctrl |= DEPCTL_SNAK;
writel(ep_ctrl, &reg->in_endp[ep_num].diepctl);
DEBUG("%s: set NAK, DIEPCTL%d = 0x%x\n",
debug("%s: set NAK, DIEPCTL%d = 0x%x\n",
__func__, ep_num, readl(&reg->in_endp[ep_num].diepctl));
} else {
ep_ctrl = readl(&reg->out_endp[ep_num].doepctl);
ep_ctrl |= DEPCTL_SNAK;
writel(ep_ctrl, &reg->out_endp[ep_num].doepctl);
DEBUG("%s: set NAK, DOEPCTL%d = 0x%x\n",
debug("%s: set NAK, DOEPCTL%d = 0x%x\n",
__func__, ep_num, readl(&reg->out_endp[ep_num].doepctl));
}
@ -936,7 +953,7 @@ void s3c_udc_ep_set_stall(struct s3c_ep *ep)
u32 ep_ctrl = 0;
ep_num = ep_index(ep);
DEBUG("%s: ep_num = %d, ep_type = %d\n", __func__, ep_num, ep->ep_type);
debug("%s: ep_num = %d, ep_type = %d\n", __func__, ep_num, ep->ep_type);
if (ep_is_in(ep)) {
ep_ctrl = readl(&reg->in_endp[ep_num].diepctl);
@ -948,7 +965,7 @@ void s3c_udc_ep_set_stall(struct s3c_ep *ep)
ep_ctrl |= DEPCTL_STALL;
writel(ep_ctrl, &reg->in_endp[ep_num].diepctl);
DEBUG("%s: set stall, DIEPCTL%d = 0x%x\n",
debug("%s: set stall, DIEPCTL%d = 0x%x\n",
__func__, ep_num, readl(&reg->in_endp[ep_num].diepctl));
} else {
@ -958,7 +975,7 @@ void s3c_udc_ep_set_stall(struct s3c_ep *ep)
ep_ctrl |= DEPCTL_STALL;
writel(ep_ctrl, &reg->out_endp[ep_num].doepctl);
DEBUG("%s: set stall, DOEPCTL%d = 0x%x\n",
debug("%s: set stall, DOEPCTL%d = 0x%x\n",
__func__, ep_num, readl(&reg->out_endp[ep_num].doepctl));
}
@ -971,7 +988,7 @@ void s3c_udc_ep_clear_stall(struct s3c_ep *ep)
u32 ep_ctrl = 0;
ep_num = ep_index(ep);
DEBUG("%s: ep_num = %d, ep_type = %d\n", __func__, ep_num, ep->ep_type);
debug("%s: ep_num = %d, ep_type = %d\n", __func__, ep_num, ep->ep_type);
if (ep_is_in(ep)) {
ep_ctrl = readl(&reg->in_endp[ep_num].diepctl);
@ -991,7 +1008,7 @@ void s3c_udc_ep_clear_stall(struct s3c_ep *ep)
}
writel(ep_ctrl, &reg->in_endp[ep_num].diepctl);
DEBUG("%s: cleared stall, DIEPCTL%d = 0x%x\n",
debug("%s: cleared stall, DIEPCTL%d = 0x%x\n",
__func__, ep_num, readl(&reg->in_endp[ep_num].diepctl));
} else {
@ -1006,7 +1023,7 @@ void s3c_udc_ep_clear_stall(struct s3c_ep *ep)
}
writel(ep_ctrl, &reg->out_endp[ep_num].doepctl);
DEBUG("%s: cleared stall, DOEPCTL%d = 0x%x\n",
debug("%s: cleared stall, DOEPCTL%d = 0x%x\n",
__func__, ep_num, readl(&reg->out_endp[ep_num].doepctl));
}
@ -1025,14 +1042,14 @@ static int s3c_udc_set_halt(struct usb_ep *_ep, int value)
if (unlikely(!_ep || !ep->desc || ep_num == EP0_CON ||
ep->desc->bmAttributes == USB_ENDPOINT_XFER_ISOC)) {
DEBUG("%s: %s bad ep or descriptor\n", __func__, ep->ep.name);
debug("%s: %s bad ep or descriptor\n", __func__, ep->ep.name);
return -EINVAL;
}
/* Attempt to halt IN ep will fail if any transfer requests
* are still queue */
if (value && ep_is_in(ep) && !list_empty(&ep->queue)) {
DEBUG("%s: %s queue not empty, req = %p\n",
debug("%s: %s queue not empty, req = %p\n",
__func__, ep->ep.name,
list_entry(ep->queue.next, struct s3c_request, queue));
@ -1040,7 +1057,7 @@ static int s3c_udc_set_halt(struct usb_ep *_ep, int value)
}
dev = ep->dev;
DEBUG("%s: ep_num = %d, value = %d\n", __func__, ep_num, value);
debug("%s: ep_num = %d, value = %d\n", __func__, ep_num, value);
spin_lock_irqsave(&dev->lock, flags);
@ -1076,7 +1093,7 @@ void s3c_udc_ep_activate(struct s3c_ep *ep)
daintmsk = (1 << ep_num) << DAINT_OUT_BIT;
}
DEBUG("%s: EPCTRL%d = 0x%x, ep_is_in = %d\n",
debug("%s: EPCTRL%d = 0x%x, ep_is_in = %d\n",
__func__, ep_num, ep_ctrl, ep_is_in(ep));
/* If the EP is already active don't change the EP Control
@ -1090,12 +1107,12 @@ void s3c_udc_ep_activate(struct s3c_ep *ep)
if (ep_is_in(ep)) {
writel(ep_ctrl, &reg->in_endp[ep_num].diepctl);
DEBUG("%s: USB Ative EP%d, DIEPCTRL%d = 0x%x\n",
debug("%s: USB Ative EP%d, DIEPCTRL%d = 0x%x\n",
__func__, ep_num, ep_num,
readl(&reg->in_endp[ep_num].diepctl));
} else {
writel(ep_ctrl, &reg->out_endp[ep_num].doepctl);
DEBUG("%s: USB Ative EP%d, DOEPCTRL%d = 0x%x\n",
debug("%s: USB Ative EP%d, DOEPCTRL%d = 0x%x\n",
__func__, ep_num, ep_num,
readl(&reg->out_endp[ep_num].doepctl));
}
@ -1103,7 +1120,7 @@ void s3c_udc_ep_activate(struct s3c_ep *ep)
/* Unmask EP Interrtupt */
writel(readl(&reg->daintmsk)|daintmsk, &reg->daintmsk);
DEBUG("%s: DAINTMSK = 0x%x\n", __func__, readl(&reg->daintmsk));
debug("%s: DAINTMSK = 0x%x\n", __func__, readl(&reg->daintmsk));
}
@ -1236,14 +1253,14 @@ static int s3c_udc_set_feature(struct usb_ep *_ep)
void s3c_ep0_setup(struct s3c_udc *dev)
{
struct s3c_ep *ep = &dev->ep[0];
int i, bytes, is_in;
int i;
u8 ep_num;
/* Nuke all previous transfers */
nuke(ep, -EPROTO);
/* read control req from fifo (8 bytes) */
bytes = s3c_fifo_read(ep, (u32 *)usb_ctrl, 8);
s3c_fifo_read(ep, (u32 *)usb_ctrl, 8);
DEBUG_SETUP("%s: bRequestType = 0x%x(%s), bRequest = 0x%x"
"\twLength = 0x%x, wValue = 0x%x, wIndex= 0x%x\n",
@ -1255,7 +1272,7 @@ void s3c_ep0_setup(struct s3c_udc *dev)
#ifdef DEBUG_S3C_UDC
{
int i, len = sizeof(*usb_ctrl);
char *p = usb_ctrl;
char *p = (char *)usb_ctrl;
printf("pkt = ");
for (i = 0; i < len; i++) {
@ -1293,11 +1310,8 @@ void s3c_ep0_setup(struct s3c_udc *dev)
/* Set direction of EP0 */
if (likely(usb_ctrl->bRequestType & USB_DIR_IN)) {
ep->bEndpointAddress |= USB_DIR_IN;
is_in = 1;
} else {
ep->bEndpointAddress &= ~USB_DIR_IN;
is_in = 0;
}
/* cope with automagic for some standard requests. */
dev->req_std = (usb_ctrl->bRequestType & USB_TYPE_MASK)

View File

@ -323,7 +323,7 @@ static void
fill_dir_slot(fsdata *mydata, dir_entry **dentptr, const char *l_name)
{
dir_slot *slotptr = (dir_slot *)get_vfatname_block;
__u8 counter, checksum;
__u8 counter = 0, checksum;
int idx = 0, ret;
char s_name[16];
@ -926,6 +926,7 @@ static int do_fat_write(const char *filename, void *buffer,
int cursect;
int root_cluster, ret = -1, name_len;
char l_filename[VFAT_MAXLEN_BYTES];
int write_size = size;
dir_curclust = 0;
@ -985,7 +986,11 @@ static int do_fat_write(const char *filename, void *buffer,
dentptr = (dir_entry *) do_fat_read_block;
name_len = strlen(filename);
if (name_len >= VFAT_MAXLEN_BYTES)
name_len = VFAT_MAXLEN_BYTES - 1;
memcpy(l_filename, filename, name_len);
l_filename[name_len] = 0; /* terminate the string */
downcase(l_filename);
startsect = mydata->rootdir_sect;
@ -1012,10 +1017,12 @@ static int do_fat_write(const char *filename, void *buffer,
}
ret = set_contents(mydata, retdent, buffer, size);
if (ret) {
if (ret < 0) {
printf("Error: writing contents\n");
goto exit;
}
write_size = ret;
debug("attempt to write 0x%x bytes\n", write_size);
/* Flush fat buffer */
ret = flush_fat_buffer(mydata);
@ -1029,7 +1036,7 @@ static int do_fat_write(const char *filename, void *buffer,
get_dentfromdir_block,
mydata->clust_size * mydata->sect_size);
if (ret) {
printf("Error: wrinting directory entry\n");
printf("Error: writing directory entry\n");
goto exit;
}
} else {
@ -1056,10 +1063,12 @@ static int do_fat_write(const char *filename, void *buffer,
start_cluster, size, 0x20);
ret = set_contents(mydata, empty_dentptr, buffer, size);
if (ret) {
if (ret < 0) {
printf("Error: writing contents\n");
goto exit;
}
write_size = ret;
debug("attempt to write 0x%x bytes\n", write_size);
/* Flush fat buffer */
ret = flush_fat_buffer(mydata);
@ -1080,7 +1089,7 @@ static int do_fat_write(const char *filename, void *buffer,
exit:
free(mydata->fatbuf);
return ret;
return ret < 0 ? ret : write_size;
}
int file_fat_write(const char *filename, void *buffer, unsigned long maxsize)

View File

@ -36,6 +36,9 @@
#define CONFIG_ENV_IS_IN_EEPROM
#endif
#define MACH_TYPE_SBC35_A9G20 1848
#define CONFIG_MACH_TYPE MACH_TYPE_SBC35_A9G20
/* ARM asynchronous clock */
#define CONFIG_SYS_AT91_SLOW_CLOCK 32768 /* slow clock xtal */
#define CONFIG_SYS_AT91_MAIN_CLOCK 12000000 /* 12.000 MHz crystal */

View File

@ -45,8 +45,12 @@
/* Define actual evaluation board type from used processor type */
#ifdef CONFIG_AT91SAM9G20
# define CONFIG_TNY_A9G20
# define MACH_TYPE_TNY_A9G20 2059
# define CONFIG_MACH_TYPE MACH_TYPE_TNY_A9G20
#else
# define CONFIG_TNY_A9260
# define MACH_TYPE_TNY_A9260 2058
# define CONFIG_MACH_TYPE MACH_TYPE_TNY_A9260
#endif
/* ARM asynchronous clock */

View File

@ -26,7 +26,7 @@
/* common */
#define spin_lock_init(...)
#define spin_lock(...)
#define spin_lock_irqsave(lock, flags) do {flags = 1; } while (0)
#define spin_lock_irqsave(lock, flags) do { debug("%lu\n", flags); } while (0)
#define spin_unlock(...)
#define spin_unlock_irqrestore(lock, flags) do {flags = 0; } while (0)
#define disable_irq(...)

View File

@ -131,16 +131,10 @@ extern struct s3c_udc *the_controller;
#define DEBUG_EP0(fmt, args...) do {} while (0)
#endif
#ifdef DEBUG_S3C_UDC
#define DEBUG(fmt, args...) printk(fmt, ##args)
#else
#define DEBUG(fmt, args...) do {} while (0)
#endif
#ifdef DEBUG_S3C_UDC_ISR
#define DEBUG_ISR(fmt, args...) printk(fmt, ##args)
#define DEBUG_ISR 1
#else
#define DEBUG_ISR(fmt, args...) do {} while (0)
#define DEBUG_ISR 0
#endif
#ifdef DEBUG_S3C_UDC_OUT_EP
@ -150,9 +144,15 @@ extern struct s3c_udc *the_controller;
#endif
#ifdef DEBUG_S3C_UDC_IN_EP
#define DEBUG_IN_EP(fmt, args...) printk(fmt, ##args)
#define DEBUG_IN_EP 1
#else
#define DEBUG_IN_EP(fmt, args...) do {} while (0)
#define DEBUG_IN_EP 0
#endif
#if defined(DEBUG_S3C_UDC_SETUP) || defined(DEBUG_S3C_UDC_EP0) || \
defined(DEBUG_S3C_UDC_ISR) || defined(DEBUG_S3C_UDC_OUT_EP) || \
defined(DEBUG_S3C_UDC_IN_EP) || defined(DEBUG_S3C_UDC)
#define DEBUG
#endif
#define ERR(stuff...) printf("ERR udc: " stuff)