Compare commits

...

53 Commits

Author SHA1 Message Date
Wolfgang Denk
cba9a894fd Prepare v2011.12
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-23 20:25:35 +01:00
Horst Kronstorfer
49fbf4371e doc/mkimage.1: Fix -D/-f options formatting
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-23 20:11:46 +01:00
Wolfgang Denk
7ddd4475a8 post/lib_powerpc/multi.c: fix stack overflow error
The code and comment disagreed: the comment claimed that r6...r31
were copied, and consequently the arrays for "src" and "dst" were
declared with 26 entries, but the actual code ("lmw r5,0(r3)" and
"stmw r5,0(r4)") copied _27_ words (r5 through r31), which resulted
in false "POST cpu Error at multi test" messages.

Fix the comment and the array sizes.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
Tested-by: Anatolij Gustschin <agust@denx.de>
2011-12-23 20:08:10 +01:00
Wolfgang Denk
38081ff7a4 post/lib_powerpc/multi.c: code cleanup
Clean up and document the code:

- get rid of unneeded code block
- add comment which code is generated

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
2011-12-23 20:07:41 +01:00
Wolfgang Denk
a63aec54a4 post/lib_powerpc/multi.c: make checkpatch clean
Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Stefan Roese <sr@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Acked-by: Anatolij Gustschin <agust@denx.de>
2011-12-23 20:06:28 +01:00
Wolfgang Denk
139e1875d3 PPC: fix "Warning: FOO uses hard float, BAR uses soft float".
It appears that with recent versions of GCC the explicit
"-mhard-float" command line option takes precedence over the
``asm(".gnu_attribute 4, 2");'' in the source file, so this no longer
helps to avoid the warnings we get when linking code that uses FP
instructions with other code that was built using soft-float.

We can remove the ".gnu_attribute" (which appears to carry no other
information, at least so far) from the object files, but we also have
to make sure we don't pull in the __gcc_qsub() and __gcc_qmul()
functions from the standard libgcc, as these would again "infect" our
linking.  We copy this code from:
	gcc-4.2.2/gcc/config/rs6000/darwin-ldouble.c
This old version was chosen because it was still available under a
compatible license (GCC v2+).   The file was stripped down to the
needed parts, and reformatted so it passes checkpatch with only one
warning (do not add new typedefs).

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Stefan Roese <sr@denx.de>
Cc: Andy Fleming <afleming@gmail.com>
Cc: Kim Phillips <kim.phillips@freescale.com>
Tested-by: Stefan Roese <sr@denx.de>
Tested-by: Anatolij Gustschin <agust@denx.de>
2011-12-23 20:03:55 +01:00
Horst Kronstorfer
af44f4b2a5 Print program basename instead of whole path in usage()
Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-22 09:09:18 +01:00
Thierry Reding
67c2cb1e69 tegra2: Fix out-of-tree build for Ventana.
Since Ventana is derived from Seaboard and requires seaboard.c to build,
make sure board/nvidia/seaboard is created in the build tree.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Wolfgang Denk <wd@denx.de>
2011-12-22 08:36:09 +01:00
Wolfgang Denk
be662e9a6b Prepare v2011.12-rc3
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-21 20:39:46 +01:00
Tom Warren
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
Horst Kronstorfer
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
Holger Brunck
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
Lauri Hintsala
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
Anatolij Gustschin
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
Anatolij Gustschin
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
Anatolij Gustschin
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
Anatolij Gustschin
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
Anatolij Gustschin
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
Anatolij Gustschin
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
Wolfgang Denk
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
Wolfgang Denk
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
Anatolij Gustschin
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
Simon Glass
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
Sven Schnelle
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
Heiko Schocher
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
Sven Schnelle
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
Marek Vasut
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
Anatolij Gustschin
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
Anatolij Gustschin
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
Heiko Schocher
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
David Müller (ELSOFT AG)
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
Chris Lalancette
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
Manfred Rudigier
c005d6b193 davinci: Fixed wrong timebase clock frequency.
Signed-off-by: Manfred Rudigier <manfred.rudigier@omicron.at>
2011-12-19 17:52:43 +01:00
Ilya Yanok
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
Marek Vasut
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
Anatolij Gustschin
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
Wolfgang Denk
901de79a37 Prepare v2011.12-rc2
Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-19 12:12:54 +01:00
Wolfgang Denk
6b62b9a31d Coding Style cleanup
Fix trailing white space, indentation by spaces instead of TABs,
excessive blank lines, trailing blank lines.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-19 12:03:40 +01:00
Wolfgang Denk
10879aa21c drivers/usb/gadget/pxa27x_udc.c: Coding Style cleanup
Commit bdbcdc89 "pxa: convert pxa27x_udc to use read and write
functions" added a number of C++ comments.  Fix these.

Signed-off-by: Wolfgang Denk <wd@denx.de>
2011-12-19 11:52:36 +01:00
Horst Kronstorfer
d3f80c77ca common/cmd_nvedit.c: Fix size calculation in do_env_import()
do_env_import() missed the final '\0' terminator when calculating the
size of an environment data block.  This led to an erroneous 'bad CRC,
import failed' message for a checksum protected environment (-c.)

Signed-off-by: Horst Kronstorfer <hkronsto@frequentis.com>
2011-12-19 10:19:34 +01:00
Kyle Moffett
a7b3918533 tools/setlocalversion: Update from the Linux Kernel
Several bugfixes have occurred upstream since this script was imported
into U-Boot.  In particular, the script currently in U-Boot does not
describe commit f8bbb4dad0 correctly,
resulting in a version of "2011.09" instead of "2011.09-01460-gf8bbb4d".

With that commit checked out, the command "git name-rev --tags HEAD"
gives this result:
  HEAD tags/v2011.12-rc1~30^2

Then the "changes" regex does not match because of the trailing '^2':
  grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$'

The new version of tools/setlocalversion in the kernel correctly handles
those situations by using different plumbing commands.

The version from the kernel is not directly usable as it does not append
the full GIT version that U-Boot expects unless the right config options
are set (CONFIG_LOCALVERSION_AUTO=y).  Other than a few minor changes
for Kconfig, the imported version is very similar to Linux v3.2-rc4.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Acked-by: Mike Frysinger <vapier@gentoo.org>
2011-12-17 20:58:48 +01:00
Wolfgang Denk
8b0affecb9 Merge branch 'master' of git://git.denx.de/u-boot-usb
* 'master' of git://git.denx.de/u-boot-usb:
  USB: Use (get|put)_unaligned for accessing wMaxPacketSize
  usb:gadget:s5p Enable the USB Gadget framework at Exynos4210 (C210 Universal)
  README: add documentation for CONFIG_USB_ULPI*
  USB: ULPI: increase error case verbosity
  USB: ULPI: clean a mixup of return types
  USB: ULPI: switch argument type from u8 to unsigned
2011-12-17 20:51:16 +01:00
Tom Rini
b2fb47f187 USB: Use (get|put)_unaligned for accessing wMaxPacketSize
In 9792987721 Stefan describes a usecase
where the previous behavior of leaving wMaxPacketSize be unaligned
caused fatal problems.  The initial fix for this problem was incomplete
however as it showed another cases of non-aligned access that previously
worked implicitly.  This switches to making sure that all access of
wMaxPacketSize are done via (get|put)_unaligned.

In order to maintain a level of readability to the code in some cases
we now use a variable for the value of wMaxPacketSize and in others, a
macro.

Cc: Minkyu Kang <mk7.kang@samsung.com>
Cc: Remy Bohmer <linux@bohmer.net>

OpenRISC:
Tested-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>

Beagleboard xM, Pandaboard run-tested, s5p_goni build-tested.
Signed-off-by: Tom Rini <trini@ti.com>
2011-12-16 21:37:17 +01:00
Lukasz Majewski
ddc7e541ae usb:gadget:s5p Enable the USB Gadget framework at Exynos4210 (C210 Universal)
This commit enables support for USB Gadgets on the Exynos4210 (C210 Universal)
reference target.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Cc: Minkyu Kang <mk7.kang@samsung.com>
CC: Remy Bohmer <linux@bohmer.net>
2011-12-16 21:37:17 +01:00
Igor Grinberg
d70a560fd7 README: add documentation for CONFIG_USB_ULPI*
Add documentation for CONFIG_USB_ULPI and CONFIG_USB_ULPI_VIEWPORT
configuration options.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
2011-12-16 21:37:16 +01:00
Igor Grinberg
cf9f95f293 USB: ULPI: increase error case verbosity
Add the argument value to the error message.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
2011-12-16 21:05:46 +01:00
Igor Grinberg
4256101f8c USB: ULPI: clean a mixup of return types
Clean a mixup between u32 and int as a return type
for functions returning error values.
Use int as it is native (and widely used) return type.

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
2011-12-16 21:03:37 +01:00
Igor Grinberg
1113a79b2a USB: ULPI: switch argument type from u8 to unsigned
There is no benefit in using u8, so switch to unsigned to reduce the
binary image size (by 20 bytes).

Signed-off-by: Igor Grinberg <grinberg@compulab.co.il>
Acked-by: Simon Glass <sjg@chromium.org>
2011-12-16 21:00:23 +01:00
Jerry Huang
509adc8b77 powerpc/mpc83xx: set TXEQA/TXEQE value for mpc837XE sata
In the current u-boot code, the value of these fields are the reserved
value (0b100), through the signal integrity measurement on freescale's
board with these reserved setting, the signal eye is out of the recommended
spec for non-transition amplitude at 500mV nominal.
According to the errata for MPC8379E, we should make a change to the
recommended setting from essentially nothing at this time to 0b001 for SATA.

Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com>
Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
2011-12-12 18:33:39 -06:00
Wolfgang Denk
06e42c6e2c Merge branch 'agust@denx.de' of git://git.denx.de/u-boot-staging
* 'agust@denx.de' of git://git.denx.de/u-boot-staging:
  pm9g45: init serial console before relocation
  pm9261: init serial console before relocation
  pm9263: init serial console before relocation
2011-12-12 14:51:16 +01:00
Asen Dimov
c4df214901 pm9g45: init serial console before relocation
The early messages can be seen on the debug console.

Signed-off-by: Asen Chavdarov Dimov <dimov@ronetix.at>
2011-12-12 10:28:57 +01:00
Asen Dimov
0160c1e1a3 pm9261: init serial console before relocation
The early messages can be seen on the debug console.

Signed-off-by: Asen Chavdarov Dimov <dimov@ronetix.at>
2011-12-12 10:28:46 +01:00
Asen Dimov
52b2601696 pm9263: init serial console before relocation
The early messages can be seen on the debug console.

Signed-off-by: Asen Chavdarov Dimov <dimov@ronetix.at>
2011-12-12 10:28:30 +01:00
70 changed files with 936 additions and 363 deletions

View File

@@ -24,7 +24,7 @@
VERSION = 2011
PATCHLEVEL = 12
SUBLEVEL =
EXTRAVERSION = -rc1
EXTRAVERSION =
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

8
README
View File

@@ -1185,6 +1185,14 @@ The following options need to be configured:
for your device
- CONFIG_USBD_PRODUCTID 0xFFFF
- ULPI Layer Support:
The ULPI (UTMI Low Pin (count) Interface) PHYs are supported via
the generic ULPI layer. The generic layer accesses the ULPI PHY
via the platform viewport, so you need both the genric layer and
the viewport enabled. Currently only Chipidea/ARC based
viewport is supported.
To enable the ULPI layer support, define CONFIG_USB_ULPI and
CONFIG_USB_ULPI_VIEWPORT in your board configuration file.
- MMC Support:
The MMC controller on the Intel PXA is supported. To

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

@@ -123,4 +123,3 @@ struct lcd_sync_arg {
void da8xx_video_init(const struct da8xx_panel *panel, int bits_pixel);
#endif /* ifndef DA8XX_FB_H */

View File

@@ -46,6 +46,7 @@
#define EXYNOS4_ADC_BASE 0x13910000
#define EXYNOS4_PWMTIMER_BASE 0x139D0000
#define EXYNOS4_MODEM_BASE 0x13A00000
#define EXYNOS4_USBPHY_CONTROL 0x10020704
#ifndef __ASSEMBLY__
#include <asm/io.h>

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

@@ -1,7 +1,7 @@
/*
* Freescale SerDes initialization routine
*
* Copyright (C) 2007 Freescale Semicondutor, Inc.
* Copyright (C) 2007,2011 Freescale Semicondutor, Inc.
* Copyright (C) 2008 MontaVista Software, Inc.
*
* Author: Li Yang <leoli@freescale.com>
@@ -20,6 +20,10 @@
/* SerDes registers */
#define FSL_SRDSCR0_OFFS 0x0
#define FSL_SRDSCR0_DPP_1V2 0x00008800
#define FSL_SRDSCR0_TXEQA_MASK 0x00007000
#define FSL_SRDSCR0_TXEQA_SATA 0x00001000
#define FSL_SRDSCR0_TXEQE_MASK 0x00000700
#define FSL_SRDSCR0_TXEQE_SATA 0x00000100
#define FSL_SRDSCR1_OFFS 0x4
#define FSL_SRDSCR1_PLLBW 0x00000040
#define FSL_SRDSCR2_OFFS 0x8
@@ -71,6 +75,11 @@ void fsl_setup_serdes(u32 offset, char proto, u32 rfcks, char vdd)
tmp &= ~FSL_SRDSRSTCTL_SATA_RESET;
out_be32(regs + FSL_SRDSRSTCTL_OFFS, tmp);
/* Configure SRDSCR0 */
clrsetbits_be32(regs + FSL_SRDSCR0_OFFS,
FSL_SRDSCR0_TXEQA_MASK | FSL_SRDSCR0_TXEQE_MASK,
FSL_SRDSCR0_TXEQA_SATA | FSL_SRDSCR0_TXEQE_SATA);
/* Configure SRDSCR1 */
tmp = in_be32(regs + FSL_SRDSCR1_OFFS);
tmp &= ~FSL_SRDSCR1_PLLBW;

View File

@@ -56,7 +56,7 @@ Boston, MA 02110-1301, USA. */
!
.global __ashrsi3
.align 2
__ashrsi3:
mov #31,r0

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

@@ -25,6 +25,7 @@
include $(TOPDIR)/config.mk
ifneq ($(OBJTREE),$(SRCTREE))
$(shell mkdir -p $(obj)../seaboard)
$(shell mkdir -p $(obj)../common)
endif

View File

@@ -237,21 +237,28 @@ void lcd_show_board_info(void)
#endif /* CONFIG_LCD */
int board_init(void)
int board_early_init_f(void)
{
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
/* Enable Ctrlc */
console_init_f();
/* Enable clocks for some PIOs */
writel(1 << ATMEL_ID_PIOA |
1 << ATMEL_ID_PIOC,
&pmc->pcer);
at91_seriald_hw_init();
return 0;
}
int board_init(void)
{
/* arch number of PM9261-Board */
gd->bd->bi_arch_number = MACH_TYPE_PM9261;
/* adress of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
at91_seriald_hw_init();
#ifdef CONFIG_CMD_NAND
pm9261_nand_hw_init();
#endif

View File

@@ -336,22 +336,28 @@ void lcd_show_board_info(void)
#endif /* CONFIG_LCD */
int board_init(void)
int board_early_init_f(void)
{
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
/* Enable Ctrlc */
console_init_f();
writel((1 << ATMEL_ID_PIOA) |
(1 << ATMEL_ID_PIOCDE) |
(1 << ATMEL_ID_PIOB),
/* Enable clocks for all PIOs */
writel((1 << ATMEL_ID_PIOA) | (1 << ATMEL_ID_PIOB) |
(1 << ATMEL_ID_PIOCDE),
&pmc->pcer);
at91_seriald_hw_init();
return 0;
}
int board_init(void)
{
/* arch number of AT91SAM9263EK-Board */
gd->bd->bi_arch_number = MACH_TYPE_PM9263;
/* adress of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
at91_seriald_hw_init();
#ifdef CONFIG_CMD_NAND
pm9263_nand_hw_init();
#endif

View File

@@ -127,22 +127,28 @@ static void pm9g45_macb_hw_init(void)
}
#endif
int board_init(void)
int board_early_init_f(void)
{
struct at91_pmc *pmc = (struct at91_pmc *)ATMEL_BASE_PMC;
/* Enable Ctrlc */
console_init_f();
/* Enable clocks for all PIOs */
writel((1 << ATMEL_ID_PIOA) |
(1 << ATMEL_ID_PIOB) |
(1 << ATMEL_ID_PIOC) |
(1 << ATMEL_ID_PIODE), &pmc->pcer);
at91_seriald_hw_init();
return 0;
}
int board_init(void)
{
/* arch number of AT91SAM9M10G45EK-Board */
gd->bd->bi_arch_number = MACH_TYPE_PM9G45;
/* adress of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
at91_seriald_hw_init();
#ifdef CONFIG_CMD_NAND
pm9g45_nand_hw_init();
#endif

View File

@@ -28,6 +28,9 @@
#include <asm/arch/gpio.h>
#include <asm/arch/mmc.h>
#include <pmic.h>
#include <usb/s3c_udc.h>
#include <asm/arch/cpu.h>
#include <max8998_pmic.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -253,3 +256,48 @@ int board_mmc_init(bd_t *bis)
}
#endif
#ifdef CONFIG_USB_GADGET
static int s5pc210_phy_control(int on)
{
int ret = 0;
struct pmic *p = get_pmic();
if (pmic_probe(p))
return -1;
if (on) {
ret |= pmic_set_output(p,
MAX8998_REG_BUCK_ACTIVE_DISCHARGE3,
MAX8998_SAFEOUT1, LDO_ON);
ret |= pmic_set_output(p, MAX8998_REG_ONOFF1,
MAX8998_LDO3, LDO_ON);
ret |= pmic_set_output(p, MAX8998_REG_ONOFF2,
MAX8998_LDO8, LDO_ON);
} else {
ret |= pmic_set_output(p, MAX8998_REG_ONOFF2,
MAX8998_LDO8, LDO_OFF);
ret |= pmic_set_output(p, MAX8998_REG_ONOFF1,
MAX8998_LDO3, LDO_OFF);
ret |= pmic_set_output(p,
MAX8998_REG_BUCK_ACTIVE_DISCHARGE3,
MAX8998_SAFEOUT1, LDO_OFF);
}
if (ret) {
puts("MAX8998 LDO setting error!\n");
return -1;
}
return 0;
}
struct s3c_plat_otg_data s5pc210_otg_data = {
.phy_control = s5pc210_phy_control,
.regs_phy = EXYNOS4_USBPHY_BASE,
.regs_otg = EXYNOS4_USBOTG_BASE,
.usb_phy_ctrl = EXYNOS4_USBPHY_CONTROL,
.usb_flags = PHY0_SLEEP,
};
#endif

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

@@ -868,7 +868,7 @@ static int do_env_import(cmd_tbl_t *cmdtp, int flag,
printf("## Warning: Input data exceeds %d bytes"
" - truncated\n", MAX_ENV_SIZE);
}
++size;
size += 2;
printf("## Info: input data size = %zu = 0x%zX\n", size, size);
}

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

@@ -28,6 +28,7 @@
#include <common.h>
#include <command.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <part.h>
#include <usb.h>
@@ -240,7 +241,7 @@ void usb_display_ep_desc(struct usb_endpoint_descriptor *epdesc)
printf("Interrupt");
break;
}
printf(" MaxPacket %d", epdesc->wMaxPacketSize);
printf(" MaxPacket %d", get_unaligned(&epdesc->wMaxPacketSize));
if ((epdesc->bmAttributes & 0x03) == 0x3)
printf(" Interval %dms", epdesc->bInterval);
printf("\n");

View File

@@ -49,6 +49,7 @@
#include <asm/processor.h>
#include <linux/ctype.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <usb.h>
#ifdef CONFIG_4xx
@@ -279,30 +280,32 @@ usb_set_maxpacket_ep(struct usb_device *dev, int if_idx, int ep_idx)
{
int b;
struct usb_endpoint_descriptor *ep;
u16 ep_wMaxPacketSize;
ep = &dev->config.if_desc[if_idx].ep_desc[ep_idx];
b = ep->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
ep_wMaxPacketSize = get_unaligned(&ep->wMaxPacketSize);
if ((ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
USB_ENDPOINT_XFER_CONTROL) {
/* Control => bidirectional */
dev->epmaxpacketout[b] = ep->wMaxPacketSize;
dev->epmaxpacketin[b] = ep->wMaxPacketSize;
dev->epmaxpacketout[b] = ep_wMaxPacketSize;
dev->epmaxpacketin[b] = ep_wMaxPacketSize;
USB_PRINTF("##Control EP epmaxpacketout/in[%d] = %d\n",
b, dev->epmaxpacketin[b]);
} else {
if ((ep->bEndpointAddress & 0x80) == 0) {
/* OUT Endpoint */
if (ep->wMaxPacketSize > dev->epmaxpacketout[b]) {
dev->epmaxpacketout[b] = ep->wMaxPacketSize;
if (ep_wMaxPacketSize > dev->epmaxpacketout[b]) {
dev->epmaxpacketout[b] = ep_wMaxPacketSize;
USB_PRINTF("##EP epmaxpacketout[%d] = %d\n",
b, dev->epmaxpacketout[b]);
}
} else {
/* IN Endpoint */
if (ep->wMaxPacketSize > dev->epmaxpacketin[b]) {
dev->epmaxpacketin[b] = ep->wMaxPacketSize;
if (ep_wMaxPacketSize > dev->epmaxpacketin[b]) {
dev->epmaxpacketin[b] = ep_wMaxPacketSize;
USB_PRINTF("##EP epmaxpacketin[%d] = %d\n",
b, dev->epmaxpacketin[b]);
}
@@ -333,6 +336,7 @@ int usb_parse_config(struct usb_device *dev, unsigned char *buffer, int cfgno)
struct usb_descriptor_header *head;
int index, ifno, epno, curr_if_num;
int i;
u16 ep_wMaxPacketSize;
ifno = -1;
epno = -1;
@@ -378,8 +382,15 @@ int usb_parse_config(struct usb_device *dev, unsigned char *buffer, int cfgno)
dev->config.if_desc[ifno].no_of_ep++;
memcpy(&dev->config.if_desc[ifno].ep_desc[epno],
&buffer[index], buffer[index]);
le16_to_cpus(&(dev->config.if_desc[ifno].ep_desc[epno].\
wMaxPacketSize));
ep_wMaxPacketSize = get_unaligned(&dev->config.\
if_desc[ifno].\
ep_desc[epno].\
wMaxPacketSize);
put_unaligned(le16_to_cpu(ep_wMaxPacketSize),
&dev->config.\
if_desc[ifno].\
ep_desc[epno].\
wMaxPacketSize);
USB_PRINTF("if %d, ep %d\n", ifno, epno);
break;
default:

View File

@@ -97,7 +97,7 @@ char *pick_a_tool(void)
printf("failed to add item!");
menu_destroy(m);
return NULL;
}
}
}
if (menu_get_choice(m, (void **)&tool) != 1)

View File

@@ -43,7 +43,7 @@ I2C:
* I2C1_CH0: EEPROM AT24C64(0x50) RCW, AT24C02(0x51) DDR SPD,
AT24C02(0x53) DDR SPD, AT24C02(0x57) SystemID, RTC DS3232(0x68)
* I2C1_CH1: 1588 RiserCard(0x55), HSLB Testport, TempMon
ADT7461(0x4C), SerDesMux DS64MB201(0x51/59/5C/5D)
ADT7461(0x4C), SerDesMux DS64MB201(0x51/59/5C/5D)
* I2C1_CH2: VDD/GVDD/GIDD ZL6100 (0x21/0x22/0x23/0x24/0x40)
* I2C1_CH3: OCM CFG AT24C02(0x55), OCM IPL AT24C64(0x56)
* I2C1_CH4: PCIe SLOT1
@@ -108,4 +108,3 @@ Place a linux uImage in the TFTP disk area.
tftp 2000000 rootfs.ext2.gz.uboot
tftp 3000000 p3060rdb.dtb
bootm 1000000 2000000 3000000

View File

@@ -115,50 +115,50 @@ Supported global commands
-------------------------
Unrecognized commands are ignored.
default <label> - the label named here is treated as the default and is
the first label 'pxe boot' attempts to boot.
default <label> - the label named here is treated as the default and is
the first label 'pxe boot' attempts to boot.
menu title <string> - sets a title for the menu of labels being displayed.
menu include <path> - use tftp to retrieve the pxe file at <path>, which
is then immediately parsed as if the start of its
contents were the next line in the current file. nesting
of include up to 16 files deep is supported.
is then immediately parsed as if the start of its
contents were the next line in the current file. nesting
of include up to 16 files deep is supported.
prompt <flag> - if 1, always prompt the user to enter a label to boot
from. if 0, only prompt the user if timeout expires.
prompt <flag> - if 1, always prompt the user to enter a label to boot
from. if 0, only prompt the user if timeout expires.
timeout <num> - wait for user input for <num>/10 seconds before
auto-booting a node.
auto-booting a node.
label <name> - begin a label definition. labels continue until
a command not recognized as a label command is seen,
or EOF is reached.
label <name> - begin a label definition. labels continue until
a command not recognized as a label command is seen,
or EOF is reached.
Supported label commands
------------------------
labels end when a command not recognized as a label command is reached, or EOF.
menu default - set this label as the default label to boot; this is
the same behavior as the global default command but
specified in a different way
menu default - set this label as the default label to boot; this is
the same behavior as the global default command but
specified in a different way
kernel <path> - if this label is chosen, use tftp to retrieve the kernel
at <path>. it will be stored at the address indicated in
the kernel_addr_r environment variable, and that address
will be passed to bootm to boot this kernel.
kernel <path> - if this label is chosen, use tftp to retrieve the kernel
at <path>. it will be stored at the address indicated in
the kernel_addr_r environment variable, and that address
will be passed to bootm to boot this kernel.
append <string> - use <string> as the kernel command line when booting this
label.
append <string> - use <string> as the kernel command line when booting this
label.
initrd <path> - if this label is chosen, use tftp to retrieve the initrd
at <path>. it will be stored at the address indicated in
the initrd_addr_r environment variable, and that address
will be passed to bootm.
initrd <path> - if this label is chosen, use tftp to retrieve the initrd
at <path>. it will be stored at the address indicated in
the initrd_addr_r environment variable, and that address
will be passed to bootm.
localboot <flag> - Run the command defined by "localcmd" in the environment.
<flag> is ignored and is only here to match the syntax of
PXELINUX config files.
<flag> is ignored and is only here to match the syntax of
PXELINUX config files.
Example
-------
@@ -217,7 +217,7 @@ PXELINUX and U-boot's pxe support.
- U-boot's pxe doesn't provide the full menu implementation that PXELINUX
does, only a simple text based menu using the commands described in
this README. With PXELINUX, it's possible to have a graphical boot
this README. With PXELINUX, it's possible to have a graphical boot
menu, submenus, passwords, etc. U-boot's pxe could be extended to support
a more robust menuing system like that of PXELINUX's.

View File

@@ -67,11 +67,10 @@ Update SPI ROM:
============================
1. Copy u-boot image to RAM area.
2. Probe SPI device.
=> sf probe 0
2. Probe SPI device.
=> sf probe 0
8192 KiB M25P64 at 0:0 is now current device
3. Erase SPI ROM.
=> sf erase 0 80000
=> sf erase 0 80000
4. Write u-boot image to SPI ROM.
=> sf write 0x89000000 0 80000

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"
@@ -82,16 +82,16 @@ Set XIP (execute in place) flag.
.B Create FIT image:
.TP
.BI "\-D "dtc option"
.BI "\-D [" "dtc options" "]"
Provide special options to the device tree compiler that is used to
create the image.
.TP
.BI "\-f "fit-image.its"
Image tree source fine that descbres the structure and contents of the
.BI "\-f [" "image tree source file" "]"
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

@@ -435,4 +435,3 @@ enum RPADIR_BIT {
enum FIFO_SIZE_BIT {
FIFO_SIZE_T = 0x00000700, FIFO_SIZE_R = 0x00000007,
};

View File

@@ -25,6 +25,7 @@
#include <config.h>
#include <circbuf.h>
#include <stdio_dev.h>
#include <asm/unaligned.h>
#include "usbtty.h"
#include "usb_cdc_acm.h"
#include "usbdescriptors.h"
@@ -626,6 +627,9 @@ static void usbtty_init_strings (void)
usb_strings = usbtty_string_table;
}
#define init_wMaxPacketSize(x) le16_to_cpu(get_unaligned(\
&ep_descriptor_ptrs[(x) - 1]->wMaxPacketSize));
static void usbtty_init_instances (void)
{
int i;
@@ -688,14 +692,12 @@ static void usbtty_init_instances (void)
endpoint_instance[i].rcv_attributes =
ep_descriptor_ptrs[i - 1]->bmAttributes;
endpoint_instance[i].rcv_packetSize =
le16_to_cpu(ep_descriptor_ptrs[i - 1]->wMaxPacketSize);
endpoint_instance[i].rcv_packetSize = init_wMaxPacketSize(i);
endpoint_instance[i].tx_attributes =
ep_descriptor_ptrs[i - 1]->bmAttributes;
endpoint_instance[i].tx_packetSize =
le16_to_cpu(ep_descriptor_ptrs[i - 1]->wMaxPacketSize);
endpoint_instance[i].tx_packetSize = init_wMaxPacketSize(i);
endpoint_instance[i].tx_attributes =
ep_descriptor_ptrs[i - 1]->bmAttributes;

View File

@@ -25,6 +25,7 @@
#include <linux/usb/ch9.h>
#include <asm/errno.h>
#include <linux/usb/gadget.h>
#include <asm/unaligned.h>
#include "gadget_chips.h"
#define isdigit(c) ('0' <= (c) && (c) <= '9')
@@ -127,7 +128,7 @@ static int ep_matches(
* where it's an output parameter representing the full speed limit.
* the usb spec fixes high speed bulk maxpacket at 512 bytes.
*/
max = 0x7ff & le16_to_cpu(desc->wMaxPacketSize);
max = 0x7ff & le16_to_cpu(get_unaligned(&desc->wMaxPacketSize));
switch (type) {
case USB_ENDPOINT_XFER_INT:
/* INT: limit 64 bytes full speed, 1024 high speed */
@@ -143,7 +144,8 @@ static int ep_matches(
return 0;
/* BOTH: "high bandwidth" works only at high speed */
if ((desc->wMaxPacketSize & __constant_cpu_to_le16(3<<11))) {
if ((get_unaligned(&desc->wMaxPacketSize) &
__constant_cpu_to_le16(3<<11))) {
if (!gadget->is_dualspeed)
return 0;
/* configure your hardware with enough buffering!! */
@@ -176,7 +178,7 @@ static int ep_matches(
/* min() doesn't work on bitfields with gcc-3.5 */
if (size > 64)
size = 64;
desc->wMaxPacketSize = cpu_to_le16(size);
put_unaligned(cpu_to_le16(size), &desc->wMaxPacketSize);
}
return 1;
}

View File

@@ -195,12 +195,12 @@ static int udc_read_urb_ep0(void)
for (i = 0; i < w; i++) {
data32[ep0_urb->actual_length / 4 + i] = readl(UDCDN(0));
// ep0_urb->actual_length += 4;
/* ep0_urb->actual_length += 4; */
}
for (i = 0; i < b; i++) {
data8[ep0_urb->actual_length + w * 4 + i] = readb(UDCDN(0));
// ep0_urb->actual_length++;
/* ep0_urb->actual_length++; */
}
ep0_urb->actual_length += n;
@@ -599,7 +599,6 @@ void udc_setup_ep(struct usb_device_instance *device, unsigned int id,
writel(tmp, UDCCN(ep_num));
//usbdbg
usbdbg("UDCCR%c = %x", 'A' + ep_num-1, readl(UDCCN(ep_num)));
usbdbg("UDCCSR%c = %x", 'A' + ep_num-1, readl(UDCCSN(ep_num)));
}

View File

@@ -40,13 +40,13 @@
#include <linux/usb/gadget.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
#include <asm/io.h>
#include <asm/mach-types.h>
#include <asm/arch/gpio.h>
#include "regs-otg.h"
#include <usb/s3c_udc.h>
#include <usb/lin_gadget_compat.h>
/***********************************************************/
@@ -72,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",
@@ -85,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"
@@ -361,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);
@@ -372,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);
}
@@ -400,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;
}
@@ -412,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)) {
@@ -455,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*/
@@ -525,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*/
@@ -580,15 +577,16 @@ 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
|| desc->bDescriptorType != USB_DT_ENDPOINT
|| ep->bEndpointAddress != desc->bEndpointAddress
|| ep_maxpacket(ep) < le16_to_cpu(desc->wMaxPacketSize)) {
|| 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;
}
@@ -597,30 +595,30 @@ 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;
}
/* hardware _could_ do smaller, but driver doesn't */
if ((desc->bmAttributes == USB_ENDPOINT_XFER_BULK
&& le16_to_cpu(desc->wMaxPacketSize) != ep_maxpacket(ep))
|| !desc->wMaxPacketSize) {
&& 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;
}
ep->stopped = 0;
ep->desc = desc;
ep->pio_irqs = 0;
ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize);
ep->ep.maxpacket = le16_to_cpu(get_unaligned(&desc->wMaxPacketSize));
/* Reset halt state */
s3c_udc_set_nak(ep);
@@ -630,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;
}
@@ -643,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;
}
@@ -662,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;
}
@@ -671,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)
@@ -687,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));
@@ -701,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)
@@ -735,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))
@@ -757,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 = {
@@ -847,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

@@ -251,5 +251,3 @@ int ehci_hcd_stop(void)
{
return 0;
}

View File

@@ -98,7 +98,7 @@ static int ulpi_request(u32 ulpi_viewport, u32 value)
return err;
}
u32 ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value)
int ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value)
{
u32 val = ULPI_RWRUN | ULPI_RWCTRL | ((u32)reg << 16) | (value & 0xff);
@@ -107,7 +107,7 @@ u32 ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value)
u32 ulpi_read(u32 ulpi_viewport, u8 *reg)
{
u32 err;
int err;
u32 val = ULPI_RWRUN | ((u32)reg << 16);
err = ulpi_request(ulpi_viewport, val);

View File

@@ -39,8 +39,8 @@ static struct ulpi_regs *ulpi = (struct ulpi_regs *)0;
static int ulpi_integrity_check(u32 ulpi_viewport)
{
u32 err, val, tval = ULPI_TEST_VALUE;
int i;
u32 val, tval = ULPI_TEST_VALUE;
int err, i;
/* Use the 'special' test value to check all bits */
for (i = 0; i < 2; i++, tval <<= 1) {
@@ -79,9 +79,9 @@ int ulpi_init(u32 ulpi_viewport)
return ulpi_integrity_check(ulpi_viewport);
}
int ulpi_select_transceiver(u32 ulpi_viewport, u8 speed)
int ulpi_select_transceiver(u32 ulpi_viewport, unsigned speed)
{
u8 tspeed = ULPI_FC_FULL_SPEED;
u32 tspeed = ULPI_FC_FULL_SPEED;
u32 val;
switch (speed) {
@@ -92,8 +92,8 @@ int ulpi_select_transceiver(u32 ulpi_viewport, u8 speed)
tspeed = speed;
break;
default:
printf("ULPI: %s: wrong transceiver speed specified, "
"falling back to full speed\n", __func__);
printf("ULPI: %s: wrong transceiver speed specified: %u, "
"falling back to full speed\n", __func__, speed);
}
val = ulpi_read(ulpi_viewport, &ulpi->function_ctrl);
@@ -127,9 +127,9 @@ int ulpi_set_pd(u32 ulpi_viewport, int enable)
return ulpi_write(ulpi_viewport, reg, val);
}
int ulpi_opmode_sel(u32 ulpi_viewport, u8 opmode)
int ulpi_opmode_sel(u32 ulpi_viewport, unsigned opmode)
{
u8 topmode = ULPI_FC_OPMODE_NORMAL;
u32 topmode = ULPI_FC_OPMODE_NORMAL;
u32 val;
switch (opmode) {
@@ -140,8 +140,8 @@ int ulpi_opmode_sel(u32 ulpi_viewport, u8 opmode)
topmode = opmode;
break;
default:
printf("ULPI: %s: wrong OpMode specified, "
"falling back to OpMode Normal\n", __func__);
printf("ULPI: %s: wrong OpMode specified: %u, "
"falling back to OpMode Normal\n", __func__, opmode);
}
val = ulpi_read(ulpi_viewport, &ulpi->function_ctrl);
@@ -154,15 +154,15 @@ int ulpi_opmode_sel(u32 ulpi_viewport, u8 opmode)
return ulpi_write(ulpi_viewport, &ulpi->function_ctrl, val);
}
int ulpi_serial_mode_enable(u32 ulpi_viewport, u8 smode)
int ulpi_serial_mode_enable(u32 ulpi_viewport, unsigned smode)
{
switch (smode) {
case ULPI_IFACE_6_PIN_SERIAL_MODE:
case ULPI_IFACE_3_PIN_SERIAL_MODE:
break;
default:
printf("ULPI: %s: unrecognized Serial Mode specified\n",
__func__);
printf("ULPI: %s: unrecognized Serial Mode specified: %u\n",
__func__, smode);
return ULPI_ERROR;
}
@@ -171,7 +171,7 @@ int ulpi_serial_mode_enable(u32 ulpi_viewport, u8 smode)
int ulpi_suspend(u32 ulpi_viewport)
{
u32 err;
int err;
err = ulpi_write(ulpi_viewport, &ulpi->function_ctrl_clear,
ULPI_FC_SUSPENDM);
@@ -214,7 +214,7 @@ int ulpi_reset_wait(u32) __attribute__((weak, alias("__ulpi_reset_wait")));
int ulpi_reset(u32 ulpi_viewport)
{
u32 err;
int err;
err = ulpi_write(ulpi_viewport,
&ulpi->function_ctrl_set, ULPI_FC_RESET);

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

@@ -103,12 +103,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
#define CONFIG_SYS_MEMTEST_END 0x1fffffff
#define CONFIG_PANIC_HANG /* do not reset board on panic */
/*
* Config the L2 Cache as L2 SRAM
*/
@@ -316,7 +310,6 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
#define _IO_BASE 0x00000000
#endif
#define CONFIG_PCI_SCAN_SHOW /* show pci devices on startup */
#define CONFIG_DOS_PARTITION
@@ -563,6 +556,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
"tftp $fdtaddr $tftppath/$fdtfile;" \
"bootm $loadaddr - $fdtaddr"
#define CONFIG_RAMBOOTCOMMAND \
"setenv bootargs root=/dev/ram rw " \
"console=$consoledev,$baudrate $othbootargs;" \

View File

@@ -161,6 +161,7 @@
#define CONFIG_INITRD_TAG 1
#undef CONFIG_SKIP_LOWLEVEL_INIT
#define CONFIG_BOARD_EARLY_INIT_F
/*
* Hardware drivers

View File

@@ -172,6 +172,7 @@
#undef CONFIG_SKIP_LOWLEVEL_INIT
#define CONFIG_USER_LOWLEVEL_INIT 1
#define CONFIG_BOARD_EARLY_INIT_F
/*
* Hardware drivers

View File

@@ -57,6 +57,7 @@
#define CONFIG_INITRD_TAG 1
#define CONFIG_SKIP_LOWLEVEL_INIT
#define CONFIG_BOARD_EARLY_INIT_F
/*
* Hardware drivers

View File

@@ -262,4 +262,8 @@
#define CONFIG_PMIC_I2C
#define CONFIG_PMIC_MAX8998
#define CONFIG_USB_GADGET
#define CONFIG_USB_GADGET_S3C_UDC_OTG
#define CONFIG_USB_GADGET_DUALSPEED
#endif /* __CONFIG_H */

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

@@ -76,6 +76,7 @@ enum {
#define MAX8998_LDO3 (1 << 2)
#define MAX8998_LDO8 (1 << 5)
#define MAX8998_SAFEOUT1 (1 << 4)
#define MAX8998_I2C_ADDR (0xCC >> 1)

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)

View File

@@ -41,7 +41,7 @@ int ulpi_init(u32 ulpi_viewport);
* ULPI_FC_LOW_SPEED, ULPI_FC_FS4LS
* returns 0 on success, ULPI_ERROR on failure.
*/
int ulpi_select_transceiver(u32 ulpi_viewport, u8 speed);
int ulpi_select_transceiver(u32 ulpi_viewport, unsigned speed);
/*
* Enable/disable VBUS.
@@ -66,7 +66,7 @@ int ulpi_set_pd(u32 ulpi_viewport, int enable);
*
* returns 0 on success, ULPI_ERROR on failure.
*/
int ulpi_opmode_sel(u32 ulpi_viewport, u8 opmode);
int ulpi_opmode_sel(u32 ulpi_viewport, unsigned opmode);
/*
* Switch to Serial Mode.
@@ -78,7 +78,7 @@ int ulpi_opmode_sel(u32 ulpi_viewport, u8 opmode);
* Switches immediately to Serial Mode.
* To return from Serial Mode, STP line needs to be asserted.
*/
int ulpi_serial_mode_enable(u32 ulpi_viewport, u8 smode);
int ulpi_serial_mode_enable(u32 ulpi_viewport, unsigned smode);
/*
* Put PHY into low power mode.
@@ -108,7 +108,7 @@ int ulpi_reset(u32 ulpi_viewport);
*
* returns 0 on success, ULPI_ERROR on failure.
*/
u32 ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value);
int ulpi_write(u32 ulpi_viewport, u8 *reg, u32 value);
/*
* Read the ULPI PHY register content via the viewport.

View File

@@ -199,7 +199,7 @@ struct usb_endpoint_descriptor {
u8 bmAttributes;
u16 wMaxPacketSize;
u8 bInterval;
} __attribute__ ((packed)) __attribute__ ((aligned(2)));
} __attribute__ ((packed));
struct usb_interface_descriptor {
u8 bLength;

View File

@@ -24,10 +24,23 @@ include $(TOPDIR)/config.mk
LIB = libpost$(ARCH)fpu.o
COBJS-$(CONFIG_HAS_POST) += fpu.o 20001122-1.o 20010114-2.o 20010226-1.o 980619-1.o
COBJS-$(CONFIG_HAS_POST) += acc1.o compare-fp-1.o mul-subnormal-single-1.o
COBJS-$(CONFIG_HAS_POST) += 20001122-1.o
COBJS-$(CONFIG_HAS_POST) += 20010114-2.o
COBJS-$(CONFIG_HAS_POST) += 20010226-1.o
COBJS-$(CONFIG_HAS_POST) += 980619-1.o
COBJS-$(CONFIG_HAS_POST) += acc1.o
COBJS-$(CONFIG_HAS_POST) += compare-fp-1.o
COBJS-$(CONFIG_HAS_POST) += fpu.o
COBJS-$(CONFIG_HAS_POST) += mul-subnormal-single-1.o
COBJS-$(CONFIG_HAS_POST) += darwin-ldouble.o
include $(TOPDIR)/post/rules.mk
CFLAGS := $(shell echo $(CFLAGS) | sed s/-msoft-float//)
CFLAGS += -mhard-float -fkeep-inline-functions
$(obj)%.o: %.c
$(CC) $(ALL_CFLAGS) -o $@.fp $< -c
$(OBJCOPY) -R .gnu.attributes $@.fp $@
rm -f $@.fp

View File

@@ -0,0 +1,141 @@
/*
* Borrowed from GCC 4.2.2 (which still was GPL v2+)
*/
/* 128-bit long double support routines for Darwin.
Copyright (C) 1993, 2003, 2004, 2005, 2006, 2007
Free Software Foundation, Inc.
This file is part of GCC.
GCC 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, or (at your option) any later
version.
In addition to the permissions in the GNU General Public License, the
Free Software Foundation gives you unlimited permission to link the
compiled version of this file into combinations with other programs,
and to distribute those combinations without any restriction coming
from the use of this file. (The General Public License restrictions
do apply in other respects; for example, they cover modification of
the file, and distribution when not linked into a combine
executable.)
GCC 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 GCC; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301, USA. */
/*
* Implementations of floating-point long double basic arithmetic
* functions called by the IBM C compiler when generating code for
* PowerPC platforms. In particular, the following functions are
* implemented: __gcc_qadd, __gcc_qsub, __gcc_qmul, and __gcc_qdiv.
* Double-double algorithms are based on the paper "Doubled-Precision
* IEEE Standard 754 Floating-Point Arithmetic" by W. Kahan, February 26,
* 1987. An alternative published reference is "Software for
* Doubled-Precision Floating-Point Computations", by Seppo Linnainmaa,
* ACM TOMS vol 7 no 3, September 1981, pages 272-283.
*/
/*
* Each long double is made up of two IEEE doubles. The value of the
* long double is the sum of the values of the two parts. The most
* significant part is required to be the value of the long double
* rounded to the nearest double, as specified by IEEE. For Inf
* values, the least significant part is required to be one of +0.0 or
* -0.0. No other requirements are made; so, for example, 1.0 may be
* represented as (1.0, +0.0) or (1.0, -0.0), and the low part of a
* NaN is don't-care.
*
* This code currently assumes big-endian.
*/
#define fabs(x) __builtin_fabs(x)
#define isless(x, y) __builtin_isless(x, y)
#define inf() __builtin_inf()
#define unlikely(x) __builtin_expect((x), 0)
#define nonfinite(a) unlikely(!isless(fabs(a), inf()))
typedef union {
long double ldval;
double dval[2];
} longDblUnion;
/* Add two 'long double' values and return the result. */
long double __gcc_qadd(double a, double aa, double c, double cc)
{
longDblUnion x;
double z, q, zz, xh;
z = a + c;
if (nonfinite(z)) {
z = cc + aa + c + a;
if (nonfinite(z))
return z;
x.dval[0] = z; /* Will always be DBL_MAX. */
zz = aa + cc;
if (fabs(a) > fabs(c))
x.dval[1] = a - z + c + zz;
else
x.dval[1] = c - z + a + zz;
} else {
q = a - z;
zz = q + c + (a - (q + z)) + aa + cc;
/* Keep -0 result. */
if (zz == 0.0)
return z;
xh = z + zz;
if (nonfinite(xh))
return xh;
x.dval[0] = xh;
x.dval[1] = z - xh + zz;
}
return x.ldval;
}
long double __gcc_qsub(double a, double b, double c, double d)
{
return __gcc_qadd(a, b, -c, -d);
}
long double __gcc_qmul(double a, double b, double c, double d)
{
longDblUnion z;
double t, tau, u, v, w;
t = a * c; /* Highest order double term. */
if (unlikely(t == 0) /* Preserve -0. */
|| nonfinite(t))
return t;
/* Sum terms of two highest orders. */
/* Use fused multiply-add to get low part of a * c. */
#ifndef __NO_FPRS__
asm("fmsub %0,%1,%2,%3" : "=f"(tau) : "f"(a), "f"(c), "f"(t));
#else
tau = fmsub(a, c, t);
#endif
v = a * d;
w = b * c;
tau += v + w; /* Add in other second-order terms. */
u = t + tau;
/* Construct long double result. */
if (nonfinite(u))
return u;
z.dval[0] = u;
z.dval[1] = (t - u) + tau;
return z.ldval;
}

View File

@@ -27,9 +27,9 @@
* CPU test
* Load/store multiple word instructions: lmw, stmw
*
* 26 consecutive words are loaded from a source memory buffer
* into GPRs r6 through r31. After that, 26 consecutive words are stored
* from the GPRs r6 through r31 into a target memory buffer. The contents
* 27 consecutive words are loaded from a source memory buffer
* into GPRs r5 through r31. After that, 27 consecutive words are stored
* from the GPRs r5 through r31 into a target memory buffer. The contents
* of the source and target buffers are then compared.
*/
@@ -38,45 +38,37 @@
#if CONFIG_POST & CONFIG_SYS_POST_CPU
extern void cpu_post_exec_02 (ulong *code, ulong op1, ulong op2);
extern void cpu_post_exec_02(ulong *code, ulong op1, ulong op2);
int cpu_post_test_multi (void)
int cpu_post_test_multi(void)
{
int ret = 0;
unsigned int i;
int flag = disable_interrupts();
int ret = 0;
unsigned int i;
ulong src[27], dst[27];
int flag = disable_interrupts();
if (ret == 0)
{
ulong src [26], dst [26];
ulong code[] =
{
ASM_LMW(5, 3, 0),
ASM_STMW(5, 4, 0),
ASM_BLR,
ulong code[] = {
ASM_LMW(5, 3, 0), /* lmw r5, 0(r3) */
ASM_STMW(5, 4, 0), /* stmr r5, 0(r4) */
ASM_BLR, /* blr */
};
for (i = 0; i < ARRAY_SIZE(src); ++i)
{
src[i] = i;
dst[i] = 0;
for (i = 0; i < ARRAY_SIZE(src); ++i) {
src[i] = i;
dst[i] = 0;
}
cpu_post_exec_02(code, (ulong)src, (ulong)dst);
cpu_post_exec_02(code, (ulong) src, (ulong) dst);
ret = memcmp(src, dst, sizeof(dst)) == 0 ? 0 : -1;
}
if (ret != 0)
{
post_log ("Error at multi test !\n");
}
if (ret != 0)
post_log("Error at multi test !\n");
if (flag)
enable_interrupts();
if (flag)
enable_interrupts();
return ret;
return ret;
}
#endif

View File

@@ -25,6 +25,9 @@
* MA 02111-1307 USA
*/
/* We want the GNU version of basename() */
#define _GNU_SOURCE
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
@@ -79,6 +82,9 @@ int main(int argc, char **argv)
struct stat txt_file_stat;
int fp, ep;
const char *prg;
prg = basename(argv[0]);
/* Parse the cmdline */
while ((option = getopt(argc, argv, "s:o:rbp:h")) != -1) {
@@ -104,11 +110,11 @@ int main(int argc, char **argv)
padbyte = strtol(optarg, NULL, 0);
break;
case 'h':
usage(argv[0]);
usage(prg);
return EXIT_SUCCESS;
default:
fprintf(stderr, "Wrong option -%c\n", option);
usage(argv[0]);
usage(prg);
return EXIT_FAILURE;
}
}
@@ -118,7 +124,7 @@ int main(int argc, char **argv)
fprintf(stderr,
"Please specify the size of the envrionnment "
"partition.\n");
usage(argv[0]);
usage(prg);
return EXIT_FAILURE;
}

View File

@@ -1,40 +1,177 @@
#!/bin/sh
# Print additional version information for non-release trees.
#
# This scripts adds local version information from the version
# control systems git, mercurial (hg) and subversion (svn).
#
# It was originally copied from the Linux kernel v3.2.0-rc4 and modified
# to support the U-Boot build-system.
#
usage() {
echo "Usage: $0 [srctree]" >&2
echo "Usage: $0 [--save-scmversion] [srctree]" >&2
exit 1
}
cd "${1:-.}" || usage
scm_only=false
srctree=.
if test "$1" = "--save-scmversion"; then
scm_only=true
shift
fi
if test $# -gt 0; then
srctree=$1
shift
fi
if test $# -gt 0 -o ! -d "$srctree"; then
usage
fi
# Check for git and a git repo.
if head=`git rev-parse --verify HEAD 2>/dev/null`; then
# Do we have an untagged version?
if git name-rev --tags HEAD | \
grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
(git describe || git describe --tags || git describe --all --long) \
2>/dev/null | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
scm_version()
{
local short
short=false
cd "$srctree"
if test -e .scmversion; then
cat .scmversion
return
fi
if test "$1" = "--short"; then
short=true
fi
# Are there uncommitted changes?
git update-index --refresh --unmerged > /dev/null
if git diff-index --name-only HEAD | grep -v "^scripts/package" \
| read dummy; then
printf '%s' -dirty
# Check for git and a git repo.
if test -e .git && head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
# If we are at a tagged commit (like "v2.6.30-rc6"), we ignore
# it, because this version is defined in the top level Makefile.
if [ -z "`git describe --exact-match 2>/dev/null`" ]; then
# If only the short version is requested, don't bother
# running further git commands
if $short; then
echo "+"
return
fi
# If we are past a tagged commit (like
# "v2.6.30-rc5-302-g72357d5"), we pretty print it.
if atag="`git describe 2>/dev/null`"; then
echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
# If we don't have a tag at all we print -g{commitish}.
else
printf '%s%s' -g $head
fi
fi
# Is this git on svn?
if git config --get svn-remote.svn.url >/dev/null; then
printf -- '-svn%s' "`git svn find-rev $head`"
fi
# Update index only on r/w media
[ -w . ] && git update-index --refresh --unmerged > /dev/null
# Check for uncommitted changes
if git diff-index --name-only HEAD | grep -v "^scripts/package" \
| read dummy; then
printf '%s' -dirty
fi
# All done with git
return
fi
# Is this git on svn?
if git config --get svn-remote.svn.url >/dev/null; then
printf -- '-svn%s' "`git svn find-rev $head`"
# Check for mercurial and a mercurial repo.
if test -d .hg && hgid=`hg id 2>/dev/null`; then
# Do we have an tagged version? If so, latesttagdistance == 1
if [ "`hg log -r . --template '{latesttagdistance}'`" == "1" ]; then
id=`hg log -r . --template '{latesttag}'`
printf '%s%s' -hg "$id"
else
tag=`printf '%s' "$hgid" | cut -d' ' -f2`
if [ -z "$tag" -o "$tag" = tip ]; then
id=`printf '%s' "$hgid" | sed 's/[+ ].*//'`
printf '%s%s' -hg "$id"
fi
fi
# Are there uncommitted changes?
# These are represented by + after the changeset id.
case "$hgid" in
*+|*+\ *) printf '%s' -dirty ;;
esac
# All done with mercurial
return
fi
# Check for svn and a svn repo.
if rev=`svn info 2>/dev/null | grep '^Last Changed Rev'`; then
rev=`echo $rev | awk '{print $NF}'`
printf -- '-svn%s' "$rev"
# All done with svn
return
fi
}
collect_files()
{
local file res
for file; do
case "$file" in
*\~*)
continue
;;
esac
if test -e "$file"; then
res="$res$(cat "$file")"
fi
done
echo "$res"
}
if $scm_only; then
if test ! -e .scmversion; then
res=$(scm_version)
echo "$res" >.scmversion
fi
exit
fi
#if test -e include/config/auto.conf; then
# . include/config/auto.conf
#else
# echo "Error: kernelrelease not valid - run 'make prepare' to update it"
# exit 1
#fi
CONFIG_LOCALVERSION=
CONFIG_LOCALVERSION_AUTO=y
# localversion* files in the build and source directory
res="$(collect_files localversion*)"
if test ! "$srctree" -ef .; then
res="$res$(collect_files "$srctree"/localversion*)"
fi
# CONFIG_LOCALVERSION and LOCALVERSION (if set)
res="${res}${CONFIG_LOCALVERSION}${LOCALVERSION}"
# scm version string if not at a tagged commit
if test "$CONFIG_LOCALVERSION_AUTO" = "y"; then
# full scm version string
res="$res$(scm_version)"
else
# append a plus sign if the repository is not in a clean
# annotated or signed tagged state (as git describe only
# looks at signed or annotated tags - git tag -a/-s) and
# LOCALVERSION= is not specified
if test "${LOCALVERSION+set}" != "set"; then
scm=$(scm_version --short)
res="$res${scm:++}"
fi
fi
# Check for svn and a svn repo.
if rev=`svn info 2>/dev/null` ; then
rev=`echo "${rev}" | grep '^Revision' | awk '{print $NF}'`
printf -- '-svn%s' $rev
fi
# Check for any localversion-* files
printf '%s' "`cat localversion-* 2>/dev/null`"
echo "$res"