aboutsummaryrefslogtreecommitdiffstats
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* fix build error in tools on darwin on newer macs (patch by dirtyfreebooter)Felix Fietkau2010-09-054-20/+0
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22934 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Zcomax device firmware tool endianness fixMichael Büsch2010-09-041-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22885 3c298f89-4303-0410-b956-a3cf2f4a3e73
* tools/firmware-utils: new tool for the Zcomax devicesGabor Juhos2010-09-032-0/+409
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22883 3c298f89-4303-0410-b956-a3cf2f4a3e73
* add a command for printing a cleaned up make target database - will be used ↵Felix Fietkau2010-09-011-0/+2
| | | | | | to analyze package dependencies at some point git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22871 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] qemu: add dependency on libuuidAndy Boyett2010-08-221-0/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22757 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] qemu: fix build failure on some systems. Closes #7767Andy Boyett2010-08-211-4/+2
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22751 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] quilt: needs autoconfAndy Boyett2010-08-141-2/+2
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22652 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] update wrt350nv2 builder to v2.3 (#7580)Florian Fainelli2010-08-102-17/+49
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22579 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] qemu: build qemu-img for packaging vmdk and vdi imagesAndy Boyett2010-08-092-0/+42
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22552 3c298f89-4303-0410-b956-a3cf2f4a3e73
* brcm47xx: Add new image generation and fix leds/reset button on WNR834B V2Hauke Mehrtens2010-08-062-0/+328
| | | | | | | | | | Thank you realopty for the patch. tools/firmware-utils/src/mkchkimg.c is from http://www.myopenrouter.com/download/10611/mkchkimg/ This closes #7702. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22516 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] sed: fix compilation on FreeBSD/AMD64Jo-Philipp Wich2010-08-061-0/+12
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22499 3c298f89-4303-0410-b956-a3cf2f4a3e73
* mostly revert commit r22396Hauke Mehrtens2010-07-301-1/+1
| | | | | | | | | | | | | | CFE does not boot images generated with these checksums because of wrong checksum. After flashing then with tftp to my Asus wl500-GPv1 the following messages are show: Null Rescue Flag. Boot program checksum is invalid Hello!! Enter Rescue Mode: (Check error) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22418 3c298f89-4303-0410-b956-a3cf2f4a3e73
* firmware-utils/trx: Endianness fixesMichael Büsch2010-07-291-4/+7
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22414 3c298f89-4303-0410-b956-a3cf2f4a3e73
* firmware-utils: The option -F was not detected.Hauke Mehrtens2010-07-271-1/+1
| | | | | | | | | This was missing in r22396 This fixes build of brcm47xx git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22398 3c298f89-4303-0410-b956-a3cf2f4a3e73
* tools/quilt: fix openSUSE/patch-2.6.1.81 issue (closes #7635)Alexandros C. Couloumbis2010-07-272-0/+12
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22397 3c298f89-4303-0410-b956-a3cf2f4a3e73
* fix CRC32 calculation for sysupgradeMarkus Wigge2010-07-271-3/+5
| | | | | | | | | | | | | | | | * reduce image size for CRC calculation by fs_mark size sysupgrade sometimes failed for me and I noticed that it was due to incorrect CRC values in trx-header after performing it. It seems that the fs_mark was completely included in the calculation and that it was nevertheless modified by sysupgrade while appending the jffs data. This only occurs for the first boot after sysupgrade as the flashmap driver recalculates the CRC to an even smaller area when it boots. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22396 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] squashfs4: fix compilation on FreeBSDJo-Philipp Wich2010-07-221-0/+10
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22347 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] yaffs2: fix compilation on FreeBSDJo-Philipp Wich2010-07-221-0/+11
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22345 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] mkimage: fix compilation on FreeBSDJo-Philipp Wich2010-07-221-1/+16
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22344 3c298f89-4303-0410-b956-a3cf2f4a3e73
* squashfs4: backport an upstream change to fix the file mode check to allow ↵Felix Fietkau2010-07-211-0/+11
| | | | | | setuid/setgid binaries (thx, ermo) - fixes #7653 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22334 3c298f89-4303-0410-b956-a3cf2f4a3e73
* tools/firmware-utils: enhance mktplinkfw utilityGabor Juhos2010-07-131-9/+278
| | | | | | | | | | | | Attached patch enhances the mktplinkfw utility: 1. existing firmware files in TP-Link format can now be inspected, showing eg. the used offsets 2. optionally the kernel and rootfs parts can be extracted (saves calculations for dd) 3. when generating firmwares, kernel entry point, load address and rootfs offset can be overwritten (for experienced users) Patch-by: Pieter "Fate" Hollants <pieter@hollants.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22169 3c298f89-4303-0410-b956-a3cf2f4a3e73
* firmware-utils/mktplinkfw: add support for the TL-WA901NDGabor Juhos2010-07-011-0/+9
| | | | | | | Patch-by: Pieter "Fate" Hollants <pieter@hollants.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22015 3c298f89-4303-0410-b956-a3cf2f4a3e73
* preset stable and try* flags for TRX2 headersMarkus Wigge2010-07-012-4/+22
| | | | | | | | | | | | * changed addpattern.c to preset the stable and try flags used in TRXv2 images to dupe CFE and pretend a stable image. * changed trx.c to calculate TRXv2 CRC with stable and try flags set to 0xFF like CFE does on startup * fixed compile warnings in trx.c by explicit casting git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22012 3c298f89-4303-0410-b956-a3cf2f4a3e73
* fixed trx version to handlingMarkus Wigge2010-06-281-1/+1
| | | | | | | I forgot to write the right trx version to the actual header... git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21986 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] remove whitespaces in imagetag toolFlorian Fainelli2010-06-201-7/+7
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21848 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Revert r21806 there are no users of it yetFlorian Fainelli2010-06-144-513/+0
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21808 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] add hcsmakeimage, for cable modems/routers based on bcm33xxFlorian Fainelli2010-06-144-0/+513
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21806 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] fix mktitanimg segfault on 64-bits hosts (#7443)Florian Fainelli2010-06-121-1/+2
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21767 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] add mktitanimg to create Titan (AR7-based) images (#6632)Florian Fainelli2010-06-063-0/+1211
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21689 3c298f89-4303-0410-b956-a3cf2f4a3e73
* libelf: get rid of CRLF encoding in the makefile (thx, danimo)Felix Fietkau2010-06-031-49/+49
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21663 3c298f89-4303-0410-b956-a3cf2f4a3e73
* get rid of CRLF encoding in various filesFelix Fietkau2010-05-161-204/+204
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21462 3c298f89-4303-0410-b956-a3cf2f4a3e73
* firmware-utils/mkzynfw: add support for the NBG460N boardGabor Juhos2010-05-142-0/+20
| | | | | | | | | Adding NBG460N/550N/550NH boards to mkzynfw. Signed-off-by: Michael Kurz <michi.kurz@googlemail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21446 3c298f89-4303-0410-b956-a3cf2f4a3e73
* firmware-utils/mkzynfw: don't use next_offset twice (closes #7273)Gabor Juhos2010-05-141-1/+1
| | | | | | | | | | The test if a file can fit in an image considers the current offset twice. So a image that would fit is too big. Thanks-to: Michael Kurz <michi.kurz@googlemail.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21445 3c298f89-4303-0410-b956-a3cf2f4a3e73
* mkimage fails to build on some systems if sed is not installed, add a ↵Felix Fietkau2010-04-271-0/+1
| | | | | | dependency to fix parallel build issues git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21210 3c298f89-4303-0410-b956-a3cf2f4a3e73
* tools/firmware-utils: add size check to the mkplanexfw toolGabor Juhos2010-04-261-4/+11
| | | | | | | Also pad the image to a 64K boundary. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21174 3c298f89-4303-0410-b956-a3cf2f4a3e73
* tools: update gmp to 4.3.2Alexandros C. Couloumbis2010-04-241-3/+3
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21147 3c298f89-4303-0410-b956-a3cf2f4a3e73
* tools: update quilt to 0.48Alexandros C. Couloumbis2010-04-241-3/+3
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21146 3c298f89-4303-0410-b956-a3cf2f4a3e73
* tools: update cloog to 0.15.9Alexandros C. Couloumbis2010-04-211-2/+2
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21071 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [toolchain] fix graphite options with gcc-4.5, add libelf for LTO, fix ↵Florian Fainelli2010-04-202-7/+55
| | | | | | mbsd_multi patch, patch from Bernhard Loos git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21046 3c298f89-4303-0410-b956-a3cf2f4a3e73
* add gcc-4.5.0 preliminary supportAlexandros C. Couloumbis2010-04-194-8/+53
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21033 3c298f89-4303-0410-b956-a3cf2f4a3e73
* mtd-utils: remove bogus include statement to make it more portableFelix Fietkau2010-04-141-2/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20853 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [cleanup] remove 'svn:executable' propertyNicolas Thill2010-04-121-0/+0
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20831 3c298f89-4303-0410-b956-a3cf2f4a3e73
* add jffs2/lzma support (not activated by default yet)Alexandros C. Couloumbis2010-04-121-0/+5031
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20828 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [brcm63xx] flashmap and image generation: reduced union bcm_tag to a single ↵Florian Fainelli2010-04-011-246/+80
| | | | | | | | | | | struct combining the elements so that it is no longer necessary to create an openwrt-only tagid and tagcrc, and elimate the tagid detection and switch statements which made dealing with imagetags overly complicated, especially since the logic would need analogs in all code that touched the imagetag. Patch from cshore. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20652 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [brcm63xx] move bcm_tag.h out of the flashmap patch so that user-land tools ↵Florian Fainelli2010-03-281-178/+1
| | | | | | can re-use it git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20548 3c298f89-4303-0410-b956-a3cf2f4a3e73
* firmware-utils/trx: add relative offset parameterGabor Juhos2010-03-271-2/+22
| | | | | | | | | * will be used for the WRT160NL board * patch by Bernhard Loos * note: rejected parts has been fixed git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20522 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] revert r18760 since it prevents people from building working eva imagesFlorian Fainelli2010-03-261-88/+26
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20437 3c298f89-4303-0410-b956-a3cf2f4a3e73
* added support for wrt54g3gv2-vf and new trx header formatMarkus Wigge2010-03-252-14/+50
| | | | | | | | | | | | | | - hacked addpattern due to changes in header format - added "-5" to addpattern, some 0xFF are needed for trx2 header "-4" broke CRC checking in CFE - hacked trx.c due to new header format version - added target to create trx-V2 images the flashmap driver possibly needs to be customized. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20433 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [tools] fix file creation mode, thanks rtzFlorian Fainelli2010-03-181-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20293 3c298f89-4303-0410-b956-a3cf2f4a3e73
* sstrip: fix a section length corruption bug (patch from #6847)Felix Fietkau2010-03-121-2/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20154 3c298f89-4303-0410-b956-a3cf2f4a3e73
+EXPORT_SYMBOL_GPL(bcm_dma_abort); + + /* DMA Manager Device Methods */ + +static void vc_dmaman_init(struct vc_dmaman *dmaman, void __iomem *dma_base, + u32 chans_available) +{ + dmaman->dma_base = dma_base; + dmaman->chan_available = chans_available; + dmaman->has_feature[BCM_DMA_FEATURE_FAST_ORD] = 0x0c; /* 2 & 3 */ + dmaman->has_feature[BCM_DMA_FEATURE_BULK_ORD] = 0x01; /* 0 */ + dmaman->has_feature[BCM_DMA_FEATURE_NORMAL_ORD] = 0xfe; /* 1 to 7 */ + dmaman->has_feature[BCM_DMA_FEATURE_LITE_ORD] = 0x7f00; /* 8 to 14 */ +} + +static int vc_dmaman_chan_alloc(struct vc_dmaman *dmaman, + unsigned required_feature_set) +{ + u32 chans; + int chan = 0; + int feature; + + chans = dmaman->chan_available; + for (feature = 0; feature < BCM_DMA_FEATURE_COUNT; feature++) + /* select the subset of available channels with the desired + features */ + if (required_feature_set & (1 << feature)) + chans &= dmaman->has_feature[feature]; + + if (!chans) + return -ENOENT; + + /* return the ordinal of the first channel in the bitmap */ + while (chans != 0 && (chans & 1) == 0) { + chans >>= 1; + chan++; + } + /* claim the channel */ + dmaman->chan_available &= ~(1 << chan); + + return chan; +} + +static int vc_dmaman_chan_free(struct vc_dmaman *dmaman, int chan) +{ + if (chan < 0) + return -EINVAL; + + if ((1 << chan) & dmaman->chan_available) + return -EIDRM; + + dmaman->chan_available |= (1 << chan); + + return 0; +} + +/* DMA Manager Monitor */ + +extern int bcm_dma_chan_alloc(unsigned required_feature_set, + void __iomem **out_dma_base, int *out_dma_irq) +{ + struct vc_dmaman *dmaman = g_dmaman; + struct platform_device *pdev = to_platform_device(dmaman_dev); + struct resource *r; + int chan; + + if (!dmaman_dev) + return -ENODEV; + + mutex_lock(&dmaman->lock); + chan = vc_dmaman_chan_alloc(dmaman, required_feature_set); + if (chan < 0) + goto out; + + r = platform_get_resource(pdev, IORESOURCE_IRQ, (unsigned int)chan); + if (!r) { + dev_err(dmaman_dev, "failed to get irq for DMA channel %d\n", + chan); + vc_dmaman_chan_free(dmaman, chan); + chan = -ENOENT; + goto out; + } + + *out_dma_base = BCM2708_DMA_CHANIO(dmaman->dma_base, chan); + *out_dma_irq = r->start; + dev_dbg(dmaman_dev, + "Legacy API allocated channel=%d, base=%p, irq=%i\n", + chan, *out_dma_base, *out_dma_irq); + +out: + mutex_unlock(&dmaman->lock); + + return chan; +} +EXPORT_SYMBOL_GPL(bcm_dma_chan_alloc); + +extern int bcm_dma_chan_free(int channel) +{ + struct vc_dmaman *dmaman = g_dmaman; + int rc; + + if (!dmaman_dev) + return -ENODEV; + + mutex_lock(&dmaman->lock); + rc = vc_dmaman_chan_free(dmaman, channel); + mutex_unlock(&dmaman->lock); + + return rc; +} +EXPORT_SYMBOL_GPL(bcm_dma_chan_free); + +int bcm_dmaman_probe(struct platform_device *pdev, void __iomem *base, + u32 chans_available) +{ + struct device *dev = &pdev->dev; + struct vc_dmaman *dmaman; + + dmaman = devm_kzalloc(dev, sizeof(*dmaman), GFP_KERNEL); + if (!dmaman) + return -ENOMEM; + + mutex_init(&dmaman->lock); + vc_dmaman_init(dmaman, base, chans_available); + g_dmaman = dmaman; + dmaman_dev = dev; + + dev_info(dev, "DMA legacy API manager, dmachans=0x%x\n", + chans_available); + + return 0; +} +EXPORT_SYMBOL(bcm_dmaman_probe); + +int bcm_dmaman_remove(struct platform_device *pdev) +{ + dmaman_dev = NULL; + + return 0; +} +EXPORT_SYMBOL(bcm_dmaman_remove); + +MODULE_LICENSE("GPL"); --- /dev/null +++ b/include/linux/platform_data/dma-bcm2708.h @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2010 Broadcom + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#ifndef _PLAT_BCM2708_DMA_H +#define _PLAT_BCM2708_DMA_H + +/* DMA CS Control and Status bits */ +#define BCM2708_DMA_ACTIVE BIT(0) +#define BCM2708_DMA_INT BIT(2) +#define BCM2708_DMA_ISPAUSED BIT(4) /* Pause requested or not active */ +#define BCM2708_DMA_ISHELD BIT(5) /* Is held by DREQ flow control */ +#define BCM2708_DMA_ERR BIT(8) +#define BCM2708_DMA_ABORT BIT(30) /* stop current CB, go to next, WO */ +#define BCM2708_DMA_RESET BIT(31) /* WO, self clearing */ + +/* DMA control block "info" field bits */ +#define BCM2708_DMA_INT_EN BIT(0) +#define BCM2708_DMA_TDMODE BIT(1) +#define BCM2708_DMA_WAIT_RESP BIT(3) +#define BCM2708_DMA_D_INC BIT(4) +#define BCM2708_DMA_D_WIDTH BIT(5) +#define BCM2708_DMA_D_DREQ BIT(6) +#define BCM2708_DMA_S_INC BIT(8) +#define BCM2708_DMA_S_WIDTH BIT(9) +#define BCM2708_DMA_S_DREQ BIT(10) + +#define BCM2708_DMA_BURST(x) (((x) & 0xf) << 12) +#define BCM2708_DMA_PER_MAP(x) ((x) << 16) +#define BCM2708_DMA_WAITS(x) (((x) & 0x1f) << 21) + +#define BCM2708_DMA_DREQ_EMMC 11 +#define BCM2708_DMA_DREQ_SDHOST 13 + +#define BCM2708_DMA_CS 0x00 /* Control and Status */ +#define BCM2708_DMA_ADDR 0x04 +/* the current control block appears in the following registers - read only */ +#define BCM2708_DMA_INFO 0x08 +#define BCM2708_DMA_SOURCE_AD 0x0c +#define BCM2708_DMA_DEST_AD 0x10 +#define BCM2708_DMA_NEXTCB 0x1C +#define BCM2708_DMA_DEBUG 0x20 + +#define BCM2708_DMA4_CS (BCM2708_DMA_CHAN(4) + BCM2708_DMA_CS) +#define BCM2708_DMA4_ADDR (BCM2708_DMA_CHAN(4) + BCM2708_DMA_ADDR) + +#define BCM2708_DMA_TDMODE_LEN(w, h) ((h) << 16 | (w)) + +/* When listing features we can ask for when allocating DMA channels give + those with higher priority smaller ordinal numbers */ +#define BCM_DMA_FEATURE_FAST_ORD 0 +#define BCM_DMA_FEATURE_BULK_ORD 1 +#define BCM_DMA_FEATURE_NORMAL_ORD 2 +#define BCM_DMA_FEATURE_LITE_ORD 3 +#define BCM_DMA_FEATURE_FAST BIT(BCM_DMA_FEATURE_FAST_ORD) +#define BCM_DMA_FEATURE_BULK BIT(BCM_DMA_FEATURE_BULK_ORD) +#define BCM_DMA_FEATURE_NORMAL BIT(BCM_DMA_FEATURE_NORMAL_ORD) +#define BCM_DMA_FEATURE_LITE BIT(BCM_DMA_FEATURE_LITE_ORD) +#define BCM_DMA_FEATURE_COUNT 4 + +struct bcm2708_dma_cb { + u32 info; + u32 src; + u32 dst; + u32 length; + u32 stride; + u32 next; + u32 pad[2]; +}; + +struct scatterlist; +struct platform_device; + +#if defined(CONFIG_DMA_BCM2708) || defined(CONFIG_DMA_BCM2708_MODULE) + +int bcm_sg_suitable_for_dma(struct scatterlist *sg_ptr, int sg_len); +void bcm_dma_start(void __iomem *dma_chan_base, dma_addr_t control_block); +void bcm_dma_wait_idle(void __iomem *dma_chan_base); +bool bcm_dma_is_busy(void __iomem *dma_chan_base); +int bcm_dma_abort(void __iomem *dma_chan_base); + +/* return channel no or -ve error */ +int bcm_dma_chan_alloc(unsigned preferred_feature_set, + void __iomem **out_dma_base, int *out_dma_irq); +int bcm_dma_chan_free(int channel); + +int bcm_dmaman_probe(struct platform_device *pdev, void __iomem *base, + u32 chans_available); +int bcm_dmaman_remove(struct platform_device *pdev); + +#else /* CONFIG_DMA_BCM2708 */ + +static inline int bcm_sg_suitable_for_dma(struct scatterlist *sg_ptr, + int sg_len) +{ + return 0; +} + +static inline void bcm_dma_start(void __iomem *dma_chan_base, + dma_addr_t control_block) { } + +static inline void bcm_dma_wait_idle(void __iomem *dma_chan_base) { } + +static inline bool bcm_dma_is_busy(void __iomem *dma_chan_base) +{ + return false; +} + +static inline int bcm_dma_abort(void __iomem *dma_chan_base) +{ + return -EINVAL; +} + +static inline int bcm_dma_chan_alloc(unsigned preferred_feature_set, + void __iomem **out_dma_base, + int *out_dma_irq) +{ + return -EINVAL; +} + +static inline int bcm_dma_chan_free(int channel) +{ + return -EINVAL; +} + +static inline int bcm_dmaman_probe(struct platform_device *pdev, + void __iomem *base, u32 chans_available) +{ + return 0; +} + +static inline int bcm_dmaman_remove(struct platform_device *pdev) +{ + return 0; +} + +#endif /* CONFIG_DMA_BCM2708 || CONFIG_DMA_BCM2708_MODULE */ + +#endif /* _PLAT_BCM2708_DMA_H */