Re: [OpenWrt-Devel] [PATCH v3 1/2] [boot/uboot-kirkwood] Pogoplug v4 support

2014-12-13 Thread nwf
(SDIO_HOST_CTRL, ctrl_reg);
++  udelay(1);
++}
++
++static void kw_mmc_set_ios(struct mmc *mmc)
++{
++#ifdef DEBUG
++  printf(%s: bus[%d] clock[%d]\n, DRIVER_NAME, mmc-bus_width, 
mmc-clock);
++#endif
++  kw_mmc_set_bus(mmc-bus_width);
++  kw_mmc_set_clk(mmc-clock);
++}
++
++static int kw_mmc_init(struct mmc *mmc)
++{
++#ifdef DEBUG
++  printf(%s: kw_mmc_init\n, DRIVER_NAME);
++#endif
++
++  /*
++  * Setting host parameters
++  * Initial Host Ctrl : Timeout : max , Normal Speed mode, 4-bit data mode
++  * Big Endian, SD memory Card, Push_pull CMD Line
++  */
++  kwsd_write(SDIO_HOST_CTRL,
++  SDIO_HOST_CTRL_TMOUT(SDIO_HOST_CTRL_TMOUT_MAX) |
++  SDIO_HOST_CTRL_DATA_WIDTH_4_BITS |
++  SDIO_HOST_CTRL_BIG_ENDIAN |
++  SDIO_HOST_CTRL_PUSH_PULL_EN |
++  SDIO_HOST_CTRL_CARD_TYPE_MEM_ONLY);
++
++  kwsd_write(SDIO_CLK_CTRL, 0);
++
++  /* enable status */
++  kwsd_write(SDIO_NOR_STATUS_EN, SDIO_POLL_MASK);
++  kwsd_write(SDIO_ERR_STATUS_EN, SDIO_POLL_MASK);
++
++  /* disable interrupts */
++  kwsd_write(SDIO_NOR_INTR_EN, 0);
++  kwsd_write(SDIO_ERR_INTR_EN, 0);
++
++  /* SW reset */
++  kwsd_write(SDIO_SW_RESET, SDIO_SW_RESET_NOW);
++
++  udelay(1);
++  return 0;
++}
++
++int kw_mmc_initialize(bd_t *bis)
++{
++  struct mmc *mmc = NULL;
++struct mmc_config *cfg = NULL;
++struct mmc_ops *ops = NULL;
++  char *name = NULL;
++
++#ifdef DEBUG
++  printf(%s: %s base_clock = %d\n, DRIVER_NAME, kirkwood_id(), 
kw_mmc_get_base_clock());
++#endif
++  mmc = malloc(sizeof(struct mmc));
++  if (!mmc)
++  return -1;
++memset(mmc, 0, sizeof(*mmc));
++
++cfg = malloc(sizeof(*cfg));
++if (cfg == NULL)
++return -1;
++memset(cfg, 0, sizeof(*cfg));
++mmc-cfg = cfg;   /* provided configuration */
++
++ops = malloc(sizeof(*ops));
++if (ops == NULL)
++return -1;
++memset(ops, 0, sizeof(*ops));
++cfg-ops = ops;
++
++name = malloc(sizeof(DRIVER_NAME)+1);
++if (name == NULL)
++return -1;
++cfg-name = name;
++
++  sprintf(cfg-name, DRIVER_NAME);
++
++  ops-send_cmd   = kw_mmc_send_cmd;
++  ops-set_ios= kw_mmc_set_ios;
++  ops-init   = kw_mmc_init;
++
++  cfg-voltages = MMC_VDD_32_33 | MMC_VDD_33_34;
++  cfg-host_caps = MMC_MODE_4BIT | MMC_MODE_HS;
++
++  cfg-f_min = kw_mmc_get_base_clock()/KW_MMC_BASE_DIV_MAX;
++  cfg-f_max = KW_MMC_CLOCKRATE_MAX;
++  cfg-b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
++
++  mmc = mmc_create (cfg, NULL);
++
++if (mmc == NULL) {
++  free(name);
++  free(ops);
++free(cfg);
++  printf(\nFailed to Initialize MMC\n);
++return -1;
++}
++
++  return 0;
++}
+diff -uNwr a/drivers/mmc/Makefile b/drivers/mmc/Makefile
+--- a/drivers/mmc/Makefile 2014-07-14 13:16:45.0 -0400
 b/drivers/mmc/Makefile 2014-11-28 01:11:29.681477900 -0500
+@@ -14,6 +14,7 @@
+ obj-$(CONFIG_GENERIC_ATMEL_MCI) += gen_atmel_mci.o
+ obj-$(CONFIG_MMC_SPI) += mmc_spi.o
+ obj-$(CONFIG_ARM_PL180_MMCI) += arm_pl180_mmci.o
++obj-$(CONFIG_KIRKWOOD_MMC) += kirkwood_mmc.o
+ obj-$(CONFIG_MV_SDHCI) += mv_sdhci.o
+ obj-$(CONFIG_MXC_MMC) += mxcmmc.o
+ obj-$(CONFIG_MXS_MMC) += mxsmmc.o
+diff -uNwr ./include/configs/mv-common.h 
/home/nwf/ee/u-boot/include/configs/mv-common.h
+--- ./include/configs/mv-common.h  2014-07-14 13:16:45.0 -0400
 /home/nwf/ee/u-boot/include/configs/mv-common.h2014-11-28 
01:11:29.681477900 -0500
+@@ -151,4 +151,14 @@
+ #define CONFIG_LZO
+ #endif
+ 
++/*
++ * Kirkwood MMC
++ */
++#if defined(CONFIG_KIRKWOOD)  defined(CONFIG_CMD_MMC)
++#define CONFIG_MMC
++#define CONFIG_GENERIC_MMC 
++#define CONFIG_KIRKWOOD_MMC
++#define CONFIG_SYS_MMC_BASE KW_SDIO_BASE
++#endif /* defined(CONFIG_KIRKWOOD)  defined(CONFIG_MMC) */
++
+ #endif /* _MV_COMMON_H */
+diff -uNwr ./include/kirkwood_mmc.h /home/nwf/ee/u-boot/include/kirkwood_mmc.h
+--- ./include/kirkwood_mmc.h   1969-12-31 19:00:00.0 -0500
 /home/nwf/ee/u-boot/include/kirkwood_mmc.h 2014-11-28 01:11:29.681477900 
-0500
+@@ -0,0 +1,268 @@
++/*
++ * (C) Copyright 2014 ebbes.eb...@gmail.com
++ *
++ * Based on
++ *
++ * (C) Copyright 2012
++ * Marvell Semiconductor www.marvell.com
++ * Written-by: GĂ©rald Kerma uboot at doukki.net
++ * 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

Re: [OpenWrt-Devel] kirkwood gcc/binutils woe?

2014-12-13 Thread nwf
On Wed, Dec 10, 2014 at 10:12:53PM +0100, Harald Geyer wrote:
 Hi!
 
 I ran into the same issue just a few days ago on mxs. Probably most,
 if not all arm targets are affected.

Applying your patch does, indeed, get me a little closer to a working
compiler.  However, when I run

$ gcc -v -o hello hello.c
[...]
 /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/collect2 --eh-frame-hdr 
-dynamic-linker /lib/ld-uClibc.so.0 -X -m armelf_linux_eabi -o hello 
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crt1.o 
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crti.o 
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crtbegin.o 
-L/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3 
-L/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/../../.. /tmp/ccjOqw9X.o 
-lgcc_s -lc -lgcc_s /usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crtend.o 
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/crtn.o
/usr/bin/ld: cannot find -lgcc
collect2: error: ld returned 1 exit status

Well, yes, that's true...

$ find / -name \*libgcc\*
/lib/libgcc_s.so.1
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libgcc_s.so.1
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libgcc_s.so
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libgcc.map
/usr/lib/opkg/info/libgcc.list
/usr/lib/opkg/info/libgcc.control

Grepping about at random I find that
/usr/lib/gcc/arm-openwrt-linux-uclibcgnueabi/4.8.3/libgcc_s.so contains the
directive 

 GROUP ( libgcc_s.so.1 -lgcc )

So I think the desire to save space expressed in
feeds/packages/devel/gcc/README is well-intentioned but possibly stale, so
maybe the following, too?  Maybe we should be removing libgcc_pic.a but not
libgcc.a?

diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile
index c8d8733..8966955 100644
--- a/devel/gcc/Makefile
+++ b/devel/gcc/Makefile
@@ -106,7 +106,6 @@ define Package/gcc/install
ln -s $(REAL_GNU_TARGET_NAME)-gcc $(1)/usr/bin/gcc
ln -s $(REAL_GNU_TARGET_NAME)-gcc 
$(1)/usr/bin/$(REAL_GNU_TARGET_NAME)-gcc-$(PKG_VERSION)
cp -ar $(PKG_INSTALL_DIR)/usr/lib/gcc $(1)/usr/lib
-   $(RM) 
$(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)/*.a
cp -ar $(TOOLCHAIN_DIR)/include 
$(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
cp -a $(TOOLCHAIN_DIR)/lib/*.{o,so*} 
$(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
cp -a $(TOOLCHAIN_DIR)/lib/*nonshared*.a  
$(1)/usr/lib/$(PKG_NAME)/$(REAL_GNU_TARGET_NAME)/$(PKG_VERSION)
diff --git a/devel/gcc/README b/devel/gcc/README
index 6cbc80d..828bd28 100644
--- a/devel/gcc/README
+++ b/devel/gcc/README
@@ -1,8 +1,5 @@
 Native GCC that runs on target.
 
-To save disk space, this GCC only supports dynamic linking on the target box,
-there are no static libraries shipped.
-
 For now, this was only tested on a mips target. Others to be done...
 
-   Christian Beier c...@shoutrlabs.com
\ No newline at end of file
+   Christian Beier c...@shoutrlabs.com


Thanks for your help so far!
--nwf;
 
 nwf writes:
   root@OpenWrt:/tmp# gcc -o hello hello.c 
   /usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi
   Supported emulations: armelf_linux armelf armelfb armelfb_linux
   collect2: error: ld returned 1 exit status
  
  And I'm really not sure what that means or what to do about it.
 
 Looks like binutils is built for OABI while gcc is built for EABI.
 Since at least mxs is actually using EABI I think gcc is right and
 binutils is wrong.
 
 Try if the following patch solves the problem. (Don't have my test
 board around right now.)
 
 diff --git a/package/devel/binutils/Makefile b/package/devel/binutils/Makefile
 index ff968b9..4aefeca 100644
 --- a/package/devel/binutils/Makefile
 +++ b/package/devel/binutils/Makefile
 @@ -48,6 +48,8 @@ endef
  TARGET_CFLAGS += $(FPIC) -Wno-unused-value
 
  CONFIGURE_ARGS += \
 + --host=$(REAL_GNU_TARGET_NAME) \
 + --target=$(REAL_GNU_TARGET_NAME) \
   --enable-shared \
   --enable-install-libiberty \
   --enable-install-libbfd
 
 HTH,
 Harald


pgpQouquLePi9.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel


[OpenWrt-Devel] [PATCHv2 2/2] [kernel] linux/kirkwood Pogoplug v4 support

2014-11-30 Thread nwf
And the other half: Linux kernel patch and DTS file for the Pogoplug v4
hardware.  I am indebted to everyone in the thread at
https://forum.openwrt.org/viewtopic.php?pid=250745#p250745 for their efforts.

Signed-off-by: Nathaniel Wesley Filardo 
8s9k8ugo5jgpi3u067229bbackmqi...@cmx.ietfng.org

diff --git a/target/linux/kirkwood/image/Makefile 
b/target/linux/kirkwood/image/Makefile
index ec1b978..9324974 100644
--- a/target/linux/kirkwood/image/Makefile
+++ b/target/linux/kirkwood/image/Makefile
@@ -135,6 +135,9 @@ Image/InstallKernel/Template/ICONNECT=$(call 
Image/InstallKernel/Template,iconne
 Image/BuildKernel/Template/POGOE02=$(call Image/BuildKernel/Template,pogo_e02)
 Image/InstallKernel/Template/POGOE02=$(call 
Image/InstallKernel/Template,pogo_e02)
 
+Image/BuildKernel/Template/POGO4=$(call Image/BuildKernel/Template,pogov4)
+Image/InstallKernel/Template/POGO4=$(call Image/InstallKernel/Template,pogov4)
+
 Image/BuildKernel/Template/IOMEGA_IX2_200=$(call 
Image/BuildKernel/Template,iomega_ix2_200)
 Image/InstallKernel/Template/IOMEGA_IX2_200=$(call 
Image/InstallKernel/Template,iomega_ix2_200)
 
diff --git a/target/linux/kirkwood/patches-3.14/160-pogoplug_v4.patch 
b/target/linux/kirkwood/patches-3.14/160-pogoplug_v4.patch
new file mode 100644
index 000..cf3f1e2
--- /dev/null
+++ b/target/linux/kirkwood/patches-3.14/160-pogoplug_v4.patch
@@ -0,0 +1,179 @@
+With much help from others at 
https://forum.openwrt.org/viewtopic.php?pid=250745#p250745
+
+--- linux-3.14.18/arch/arm/boot/dts/Makefile.orig
 linux-3.14.18/arch/arm/boot/dts/Makefile
+@@ -114,6 +114,7 @@
+   kirkwood-openblocks_a6.dtb \
+   kirkwood-openblocks_a7.dtb \
+   kirkwood-pogo_e02.dtb \
++  kirkwood-pogov4.dtb \
+   kirkwood-sheevaplug.dtb \
+   kirkwood-sheevaplug-esata.dtb \
+   kirkwood-topkick.dtb \
+
+
+--- /dev/null
 linux-3.14.18/arch/arm/boot/dts/kirkwood-pogov4.dts
+@@ -0,0 +1,161 @@
++/dts-v1/;
++
++#include kirkwood.dtsi
++#include kirkwood-6281.dtsi
++
++/ {
++model = Pogoplug V4;
++compatible = cloudengines,pogoplugv4, marvell,kirkwood-88f6192, 
marvell,kirkwood;
++
++memory {
++device_type = memory;
++reg = 0x 0x800;
++};
++
++chosen {
++bootargs = console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p1 
rootdelay=10;
++};
++
++mbus {
++pcie-controller {
++status = okay;
++
++pcie@1,0 {
++status = okay;
++};
++};
++};
++
++ocp@f100 {
++pinctrl: pinctrl@1 {
++pmx_led_green: pmx-led-green {
++marvell,pins = mpp22;
++marvell,function = gpio;
++};
++pmx_led_red: pmx-led-red {
++marvell,pins = mpp24;
++marvell,function = gpio;
++};
++pmx_sdio_cd: pmx-sdio-cd {
++marvell,pins = mpp27;
++marvell,function = gpio;
++};
++pmx_sdio_wp: pmx-sdio-wp {
++marvell,pins = mpp28;
++marvell,function = gpio;
++};
++pmx_button_eject: pmx-button-eject {
++marvell,pins = mpp29;
++marvell,function = gpio;
++};
++};
++
++spi@10600 {
++status = okay;
++
++m25p05@0 {
++compatible = m25p05-nonjedec;
++reg = 0;
++spi-max-frequency = 2000;
++mode = 0;
++};
++};
++
++serial@12000 {
++status = ok;
++};
++
++sata@8 {
++status = okay;
++nr-ports = 1;
++};
++
++i2c0: i2c@11000 {
++status = ok;
++};
++
++mvsdio@9 {
++pinctrl-0 = pmx_sdio pmx_sdio_cd pmx_sdio_wp;
++pinctrl-names = default;
++status = okay;
++cd-gpios = gpio0 27 1;
++wp-gpios = gpio0 28 1;
++};
++};
++
++gpio-leds {
++compatible = gpio-leds;
++pinctrl-0 = pmx_led_green pmx_led_red;
++pinctrl-names = default;
++health {
++label = status:green:health;
++gpios = gpio0 22 1;
++linux,default-trigger = default-on;
++};
++fault {
++label = status:red:fault;
++gpios = gpio0 24 1;
++linux,default-trigger = none;
++};
++};
++
++gpio_keys {
++compatible = gpio-keys;
++#address-cells = 1;
++#size-cells = 0;
++pinctrl-0 = pmx_button_eject;
++pinctrl-names = default;
++
++button@1 {
++label = Eject Button;
++linux,code = KEY_EJECTCD;
++gpios = gpio0 29 1;
++};
++};
++};
++
++mdio {
++status = okay;
++
++ethphy0: ethernet-phy@0 {
++device_type = ethernet-phy;
++reg = 0;
++};

[OpenWrt-Devel] Pogoplug V4 support

2014-10-25 Thread nwf
Salutations openwrt-devel@,

I've gotten an initial Pogoplug V4 build into good enough shape that I think
it's worth sharing.  It uses a lightly-tweaked fork of uBoot for the moment
(though I'm hoping the tweaks eventually make it back into mainline) and uses
FDT to bring up the kernel.  Thoughts are welcome.

--nwf;


diff --git a/package/boot/uboot-kirkwood-mibodhi/Makefile 
b/package/boot/uboot-kirkwood-mibodhi/Makefile
new file mode 100644
index 000..6855a91
--- /dev/null
+++ b/package/boot/uboot-kirkwood-mibodhi/Makefile
@@ -0,0 +1,103 @@
+#
+# Copyright (C) 2010-2014 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=u-boot
+PKG_VERSION:=2014.07-mibodhi
+PKG_RELEASE:=1
+
+PKG_SOURCE_URL:=g...@github.com:nwf/u-boot-kirkwood.git
+PKG_SOURCE_PROTO:=git
+PKG_SOURCE_VERSION:=23217407aab5494d7c17b0c5b0b1aabb13e4c26e
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
+
+PKG_BUILD_PARALLEL:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define uboot/Default
+  TITLE:=
+  CONFIG:=
+  IMAGE:=
+endef
+
+define uboot/pogo4
+  TITLE:=U-Boot for Cloud Engines Pogoplug V4
+  CONFIG:=pogo_v4
+endef
+
+UBOOTS:= pogo4
+
+define Package/uboot/template
+define Package/uboot-kirkwood-$(1)
+  SECTION:=boot
+  CATEGORY:=Boot Loaders
+  DEPENDS:=@TARGET_kirkwood
+  TITLE:=$(2)
+  URL:=http://www.denx.de/wiki/U-Boot
+  VARIANT:=$(1)
+endef
+endef
+
+define BuildUBootPackage
+   $(eval $(uboot/Default))
+   $(eval $(uboot/$(1)))
+   $(call Package/uboot/template,$(1),$(TITLE))
+endef
+
+ifdef BUILD_VARIANT
+$(eval $(call uboot/$(BUILD_VARIANT)))
+UBOOT_CONFIG:=$(if $(CONFIG),$(CONFIG),$(BUILD_VARIANT))
+UBOOT_IMAGE:=$(if 
$(IMAGE),$(IMAGE),openwrt-$(BOARD)-$(BUILD_VARIANT)-u-boot.bin)
+endif
+
+define Build/Configure
+   +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+   $(UBOOT_CONFIG)_config
+endef
+
+define Build/Compile
+   +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR) \
+   u-boot.kwb \
+   CROSS_COMPILE=$(TARGET_CROSS)
+   mkimage -A $(ARCH) -O linux -T kernel -C none \
+   -a 0x60 -e 0x60 \
+   -n 'OpenWrt Das U-Boot uImage' \
+   -d $(PKG_BUILD_DIR)/u-boot.bin $(PKG_BUILD_DIR)/u-boot.img
+endef
+
+define Package/uboot/install/default
+   $(INSTALL_DIR) $(BIN_DIR)/uboot-$(BOARD)-$(1)
+   $(CP) $(PKG_BUILD_DIR)/u-boot.bin \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.bin
+   $(CP) $(PKG_BUILD_DIR)/u-boot.kwb \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.kwb
+   $(CP) $(PKG_BUILD_DIR)/u-boot.img \
+   $(BIN_DIR)/uboot-$(BOARD)-$(1)/openwrt-$(BOARD)-$(1)-u-boot.img
+   $(INSTALL_DIR) $(BIN_DIR)/u-boot-kwboot/
+   $(CP) $(PKG_BUILD_DIR)/tools/kwboot \
+   $(BIN_DIR)/u-boot-kwboot/
+endef
+
+define Package/uboot/install/template
+define Package/uboot-kirkwood-$(1)/install
+   $(call Package/uboot/install/default,$(2))
+endef
+endef
+
+$(foreach u,$(UBOOTS), \
+   $(eval $(call Package/uboot/install/template,$(u),$(u))) \
+)
+
+$(foreach u,$(UBOOTS), \
+   $(eval $(call BuildUBootPackage,$(u))) \
+   $(eval $(call BuildPackage,uboot-kirkwood-$(u))) \
+)
diff --git 
a/package/boot/uboot-kirkwood-mibodhi/patches/200-openwrt-config.patch 
b/package/boot/uboot-kirkwood-mibodhi/patches/200-openwrt-config.patch
new file mode 100644
index 000..8abbfe6
--- /dev/null
+++ b/package/boot/uboot-kirkwood-mibodhi/patches/200-openwrt-config.patch
@@ -0,0 +1,109 @@
+--- /dev/null
 b/include/configs/openwrt-kirkwood-common.h
+@@ -0,0 +1,47 @@
++/*
++ * Copyright (C) 2013 Luka Perkov l...@openwrt.org
++ *
++ * SPDX-License-Identifier:   GPL-2.0+
++ */
++
++#ifndef __OPENWRT_KIRKWOOD_COMMON_H
++#define __OPENWRT_KIRKWOOD_COMMON_H
++
++/* Commands */
++#define CONFIG_CMD_BOOTZ
++
++#if defined(CONFIG_CMD_NET)
++#define CONFIG_CMD_DHCP
++#define CONFIG_CMD_PING
++#endif
++
++/* Auto boot */
++#undef CONFIG_BOOTDELAY
++#define CONFIG_BOOTDELAY  3
++
++/* Ethernet */
++#if defined(CONFIG_CMD_NET)
++#define CONFIG_SERVERIP   192.168.1.2
++#define CONFIG_IPADDR 192.168.1.1
++#endif
++
++/* second stage loader */
++#if defined(CONFIG_SECOND_STAGE)
++#undef CONFIG_ENV_IS_IN_NAND
++#undef CONFIG_ENV_SECT_SIZE
++#define CONFIG_ENV_IS_NOWHERE
++#endif
++
++/* Flattened Device Tree */
++#define CONFIG_OF_LIBFDT
++
++/* Flattened uImage Tree */
++#define CONFIG_FIT
++#define CONFIG_FIT_VERBOSE
++
++/* Various */
++#define CONFIG_BZIP2
++#define CONFIG_LZMA
++#define CONFIG_LZO
++
++#endif /* __OPENWRT_KIRKWOOD_COMMON_H */
+--- a/include/configs/pogo_v4.h
 b/include/configs/pogo_v4.h
+@@ -94,19 +94,40 @@
+  * Default environment

Re: [OpenWrt-Devel] Add kernel modules for AFS client

2014-04-27 Thread nwf
Take three.  This time, I gave up on the dynamic support of fscache, preferring
to always have it compiled in and wired up as a dependency.  There's clearly
some intended ability to do dynamic dispatch in the makefiles here (see, e.g.,
the handling of CONFIG_OF), but I couldn't make it work for me here.  I think I
have all the requisite calls to subroutines, too.

I have a second patch below which turns on fscache support in the other exposed
network filesystems, namely NFS and CIFS, now that it's exposed.

Cheers,
--nwf;

diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk
index dbeffa7..0df2fbc 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -277,6 +277,17 @@ endef
 
 $(eval $(call KernelPackage,crypto-cbc))
 
+define KernelPackage/crypto-pcbc
+  TITLE:=Propagating Cipher Block Chaining CryptoAPI module
+  DEPENDS:=+kmod-crypto-manager
+  KCONFIG:=CONFIG_CRYPTO_PCBC
+  FILES:=$(LINUX_DIR)/crypto/pcbc.ko
+  AUTOLOAD:=$(call AutoLoad,09,pcbc)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-pcbc))
+
 define KernelPackage/crypto-crc32c
   TITLE:=CRC32c CRC module
   DEPENDS:=+kmod-crypto-hash
@@ -312,6 +323,16 @@ endef
 $(eval $(call KernelPackage,crypto-deflate))
 
 
+define KernelPackage/crypto-fcrypt
+  TITLE:=FCRYPT cipher CryptoAPI module
+  KCONFIG:=CONFIG_CRYPTO_FCRYPT
+  FILES:=$(LINUX_DIR)/crypto/fcrypt.ko
+  AUTOLOAD:=$(call AutoLoad,09,fcrypt)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-fcrypt))
+
 define KernelPackage/crypto-ecb
   TITLE:=Electronic CodeBook CryptoAPI module
   DEPENDS:=+kmod-crypto-manager
@@ -429,7 +450,6 @@ define KernelPackage/crypto-misc
$(if $(call kernel_patchver_ge,3.7),$(LINUX_DIR)/crypto/cast_common.ko) 
\
$(LINUX_DIR)/crypto/cast5$(cast56_mod_suffix).ko \
$(LINUX_DIR)/crypto/cast6$(cast56_mod_suffix).ko \
-   $(LINUX_DIR)/crypto/fcrypt.ko \
$(LINUX_DIR)/crypto/khazad.ko \
$(LINUX_DIR)/crypto/sha512_generic.ko \
$(LINUX_DIR)/crypto/tea.ko \
diff --git a/package/kernel/linux/modules/fs.mk 
b/package/kernel/linux/modules/fs.mk
index cd27e4a..5faaf37 100644
--- a/package/kernel/linux/modules/fs.mk
+++ b/package/kernel/linux/modules/fs.mk
@@ -7,6 +7,43 @@
 
 FS_MENU:=Filesystems
 
+define KernelPackage/fs-fscache
+  SUBMENU:=$(FS_MENU)
+  TITLE:=General filesystem local cache manager
+  DEPENDS:=
+  KCONFIG:=\
+   CONFIG_FSCACHE=m \
+   CONFIG_FSCACHE_STATS=y \
+   CONFIG_FSCACHE_HISTOGRAM=n \
+   CONFIG_FSCACHE_DEBUG=n \
+   CONFIG_FSCACHE_OBJECT_LIST=n \
+   CONFIG_CACHEFILES=y \
+   CONFIG_CACHEFILES_DEBUG=n \
+   CONFIG_CACHEFILES_HISTOGRAM=n
+  FILES:=$(LINUX_DIR)/fs/fscache/fscache.ko
+  AUTOLOAD:=$(call AutoLoad,29,fscache)
+endef
+
+$(eval $(call KernelPackage,fs-fscache))
+
+define KernelPackage/fs-afs
+  SUBMENU:=$(FS_MENU)
+  TITLE:=Andrew FileSystem client
+  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver +kmod-fs-fscache
+  KCONFIG:=\
+   CONFIG_AFS_FS=m \
+   CONFIG_AFS_DEBUG=n \
+   CONFIG_AFS_FSCACHE=y
+  FILES:=$(LINUX_DIR)/fs/afs/kafs.ko
+  AUTOLOAD:=$(call AutoLoad,30,kafs)
+endef
+
+define KernelPackage/fs-afs/description
+  Kernel module for Andrew FileSystem client support
+endef
+
+$(eval $(call KernelPackage,fs-afs))
+
 define KernelPackage/fs-autofs4
   SUBMENU:=$(FS_MENU)
   TITLE:=AUTOFS4 filesystem support
diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index 6f61630..fc85e22 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -938,3 +938,32 @@ endef
 
 $(eval $(call KernelPackage,slip))
 
+define KernelPackage/dnsresolver
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=In-kernel DNS Resolver
+  KCONFIG:= CONFIG_DNS_RESOLVER
+  FILES:=$(LINUX_DIR)/net/dns_resolver/dns_resolver.ko
+  AUTOLOAD:=$(call AutoLoad,30,dns_resolver)
+endef
+
+$(eval $(call KernelPackage,dnsresolver))
+
+define KernelPackage/rxrpc
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=AF_RXRPC support
+  KCONFIG:= \
+   CONFIG_AF_RXRPC \
+   CONFIG_RXKAD=m \
+   CONFIG_AF_RXRPC_DEBUG=n
+  FILES:= \
+   $(LINUX_DIR)/net/rxrpc/af-rxrpc.ko \
+   $(LINUX_DIR)/net/rxrpc/rxkad.ko
+  AUTOLOAD:=$(call AutoLoad,30,rxkad af-rxrpc)
+  DEPENDS:=+kmod-crypto-core +kmod-crypto-manager +kmod-crypto-pcbc 
+kmod-crypto-fcrypt
+endef
+
+define KernelPackage/rxrpc/description
+  Kernel support for AF_RXRPC; required for AFS client
+endef
+
+$(eval $(call KernelPackage,rxrpc))





diff --git a/package/kernel/linux/modules/fs.mk 
b/package/kernel/linux/modules/fs.mk
index 5faaf37..dc8873b 100644
--- a/package/kernel/linux/modules/fs.mk
+++ b/package/kernel/linux/modules/fs.mk
@@ -85,11 +85,13 @@ define KernelPackage/fs-cifs
   KCONFIG:= \
CONFIG_CIFS \
CONFIG_CIFS_DFS_UPCALL=n \
-   CONFIG_CIFS_UPCALL=n

Re: [OpenWrt-Devel] Add kernel modules for AFS client

2014-04-20 Thread nwf
On Thu, Apr 17, 2014 at 12:07:31AM +0200, Zoltan HERPAI wrote:
 Hi,
 
 nwf wrote:
  Salutations, list.  This patch adds configuration knobs for the in-kernel 
  kAFS
  client and its dependencies.  We have an AFS cell used for shared 
  configuration
  files and nightly snapshots of local state, and having our OpenWRT devices 
  be
  able to play along would be fantastic.  Hopefully I didn't break anything.
  Thoughts welcome!

 
 Can you please update the path package/kernel/modules to 
 package/kernel/linux/modules, update the fcrypt part (the crypto-misc 
 module list has slightly changed) and resubmit the patch as v2. Pending 
 these fixed, this looks good to get an ack.
 
 Thanks,
 Zoltan H

Fixed; while here I took the liberty of making an FSCACHE option and splitting
out the AFS FSCACHE flag to its own knob.

Signed-Off-By: Nathaniel Wesley Filardo 
8s9k8ugo5jgpi3u067229bbackmqi...@cmx.ietfng.org

diff --git a/package/kernel/linux/modules/crypto.mk 
b/package/kernel/linux/modules/crypto.mk
index dbeffa7..0df2fbc 100644
--- a/package/kernel/linux/modules/crypto.mk
+++ b/package/kernel/linux/modules/crypto.mk
@@ -277,6 +277,17 @@ endef
 
 $(eval $(call KernelPackage,crypto-cbc))
 
+define KernelPackage/crypto-pcbc
+  TITLE:=Propagating Cipher Block Chaining CryptoAPI module
+  DEPENDS:=+kmod-crypto-manager
+  KCONFIG:=CONFIG_CRYPTO_PCBC
+  FILES:=$(LINUX_DIR)/crypto/pcbc.ko
+  AUTOLOAD:=$(call AutoLoad,09,pcbc)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-pcbc))
+
 define KernelPackage/crypto-crc32c
   TITLE:=CRC32c CRC module
   DEPENDS:=+kmod-crypto-hash
@@ -312,6 +323,16 @@ endef
 $(eval $(call KernelPackage,crypto-deflate))
 
 
+define KernelPackage/crypto-fcrypt
+  TITLE:=FCRYPT cipher CryptoAPI module
+  KCONFIG:=CONFIG_CRYPTO_FCRYPT
+  FILES:=$(LINUX_DIR)/crypto/fcrypt.ko
+  AUTOLOAD:=$(call AutoLoad,09,fcrypt)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-fcrypt))
+
 define KernelPackage/crypto-ecb
   TITLE:=Electronic CodeBook CryptoAPI module
   DEPENDS:=+kmod-crypto-manager
@@ -429,7 +450,6 @@ define KernelPackage/crypto-misc
$(if $(call kernel_patchver_ge,3.7),$(LINUX_DIR)/crypto/cast_common.ko) 
\
$(LINUX_DIR)/crypto/cast5$(cast56_mod_suffix).ko \
$(LINUX_DIR)/crypto/cast6$(cast56_mod_suffix).ko \
-   $(LINUX_DIR)/crypto/fcrypt.ko \
$(LINUX_DIR)/crypto/khazad.ko \
$(LINUX_DIR)/crypto/sha512_generic.ko \
$(LINUX_DIR)/crypto/tea.ko \
diff --git a/package/kernel/linux/modules/fs.mk 
b/package/kernel/linux/modules/fs.mk
index cd27e4a..a25a3f0 100644
--- a/package/kernel/linux/modules/fs.mk
+++ b/package/kernel/linux/modules/fs.mk
@@ -7,6 +7,46 @@
 
 FS_MENU:=Filesystems
 
+define KernelPackage/fs-cache
+  SUBMENU:=$(FS_MENU)
+  TITLE:=General filesystem local cache manager
+  DEPENDS:=
+  KCONFIG:=CONFIG_FSCACHE=m
+  FILES:=$(LINUX_DIR)/fs/fscache/fscache.ko
+  AUTOLOAD:=$(call AutoLoad,30,fscache)
+endef
+
+define KernelPackage/fs-afs
+  SUBMENU:=$(FS_MENU)
+  TITLE:=Andrew FileSystem client
+  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver
+  KCONFIG:=\
+   CONFIG_AFS_FS=m \
+   CONFIG_AFS_DEBUG=n
+  FILES:=$(LINUX_DIR)/fs/afs/kafs.ko
+  AUTOLOAD:=$(call AutoLoad,31,kafs)
+endef
+
+define KernelPackage/fs-afs/description
+  Kernel module for Andrew FileSystem client support
+endef
+
+define KernelPackage/fs-afs-fscache
+  SUBMENU:=$(FS_MENU)
+  TITLE:=Andrew FileSystem client fscache support
+  DEPENDS:=+kmod-fs-afs
+  KCONFIG:=CONFIG_AFS_FSCACHE=y
+  FILES:=$(LINUX_DIR)/fs/afs/kafs.ko
+  AUTOLOAD:=$(call AutoLoad,31,kafs)
+endef
+
+define KernelPackage/fs-afs-fscache/description
+  Add support for using fscache to the AFS client module.
+  This simply changes the way the module is built.
+endef
+
+$(eval $(call KernelPackage,fs-afs))
+
 define KernelPackage/fs-autofs4
   SUBMENU:=$(FS_MENU)
   TITLE:=AUTOFS4 filesystem support
diff --git a/package/kernel/linux/modules/netsupport.mk 
b/package/kernel/linux/modules/netsupport.mk
index 6f61630..fc85e22 100644
--- a/package/kernel/linux/modules/netsupport.mk
+++ b/package/kernel/linux/modules/netsupport.mk
@@ -938,3 +938,32 @@ endef
 
 $(eval $(call KernelPackage,slip))
 
+define KernelPackage/dnsresolver
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=In-kernel DNS Resolver
+  KCONFIG:= CONFIG_DNS_RESOLVER
+  FILES:=$(LINUX_DIR)/net/dns_resolver/dns_resolver.ko
+  AUTOLOAD:=$(call AutoLoad,30,dns_resolver)
+endef
+
+$(eval $(call KernelPackage,dnsresolver))
+
+define KernelPackage/rxrpc
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=AF_RXRPC support
+  KCONFIG:= \
+   CONFIG_AF_RXRPC \
+   CONFIG_RXKAD=m \
+   CONFIG_AF_RXRPC_DEBUG=n
+  FILES:= \
+   $(LINUX_DIR)/net/rxrpc/af-rxrpc.ko \
+   $(LINUX_DIR)/net/rxrpc/rxkad.ko
+  AUTOLOAD:=$(call AutoLoad,30,rxkad af-rxrpc)
+  DEPENDS:=+kmod-crypto-core +kmod-crypto-manager +kmod-crypto-pcbc 
+kmod-crypto-fcrypt
+endef
+
+define KernelPackage/rxrpc/description

[OpenWrt-Devel] Add kernel modules for AFS client

2014-03-22 Thread nwf
Salutations, list.  This patch adds configuration knobs for the in-kernel kAFS
client and its dependencies.  We have an AFS cell used for shared configuration
files and nightly snapshots of local state, and having our OpenWRT devices be
able to play along would be fantastic.  Hopefully I didn't break anything.
Thoughts welcome!

Thanks,
--nwf;

diff --git a/package/kernel/modules/crypto.mk b/package/kernel/modules/crypto.mk
index 791b5a5..4664e4a 100644
--- a/package/kernel/modules/crypto.mk
+++ b/package/kernel/modules/crypto.mk
@@ -220,6 +220,17 @@ endef
 
 $(eval $(call KernelPackage,crypto-cbc))
 
+define KernelPackage/crypto-pcbc
+  TITLE:=Propagating Cipher Block Chaining CryptoAPI module
+  DEPENDS:=+kmod-crypto-manager
+  KCONFIG:=CONFIG_CRYPTO_PCBC
+  FILES:=$(LINUX_DIR)/crypto/pcbc.ko
+  AUTOLOAD:=$(call AutoLoad,09,pcbc)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-pcbc))
+
 define KernelPackage/crypto-crc32c
   TITLE:=CRC32c CRC module
   DEPENDS:=+kmod-crypto-hash
@@ -252,6 +263,16 @@ endef
 
 $(eval $(call KernelPackage,crypto-deflate))
 
+define KernelPackage/crypto-fcrypt
+  TITLE:=FCRYPT cipher CryptoAPI module
+  KCONFIG:=CONFIG_CRYPTO_FCRYPT
+  FILES:=$(LINUX_DIR)/crypto/fcrypt.ko
+  AUTOLOAD:=$(call AutoLoad,09,fcrypt)
+  $(call AddDepends/crypto)
+endef
+
+$(eval $(call KernelPackage,crypto-fcrypt))
+
 define KernelPackage/crypto-ecb
   TITLE:=Electronic CodeBook CryptoAPI module
   DEPENDS:=+kmod-crypto-manager
@@ -350,7 +371,6 @@ define KernelPackage/crypto-misc
$(LINUX_DIR)/crypto/camellia.ko \
$(LINUX_DIR)/crypto/cast5.ko \
$(LINUX_DIR)/crypto/cast6.ko \
-   $(LINUX_DIR)/crypto/fcrypt.ko \
$(LINUX_DIR)/crypto/khazad.ko \
$(LINUX_DIR)/crypto/sha256_generic.ko \
$(LINUX_DIR)/crypto/sha512_generic.ko \
diff --git a/package/kernel/modules/fs.mk b/package/kernel/modules/fs.mk
index f1853f7..dc350d0 100644
--- a/package/kernel/modules/fs.mk
+++ b/package/kernel/modules/fs.mk
@@ -7,6 +7,24 @@
 
 FS_MENU:=Filesystems
 
+define KernelPackage/fs-afs
+  SUBMENU:=$(FS_MENU)
+  TITLE:=Andrew FileSystem client
+  DEPENDS:=+kmod-rxrpc +kmod-dnsresolver
+  KCONFIG:=\
+   CONFIG_AFS_FS \
+   CONFIG_AFS_FSCACHE=y \
+   CONFIG_AFS_DEBUG=n
+  FILES:=$(LINUX_DIR)/fs/afs/kafs.ko
+  AUTOLOAD:=$(call AutoLoad,31,kafs)
+endef
+
+define KernelPackage/fs-afs/description
+  Kernel module for Andrew FileSystem client support
+endef
+
+$(eval $(call KernelPackage,fs-afs))
+
 define KernelPackage/fs-autofs4
   SUBMENU:=$(FS_MENU)
   TITLE:=AUTOFS4 filesystem support
diff --git a/package/kernel/modules/netsupport.mk 
b/package/kernel/modules/netsupport.mk
index b4e2a42..36cb4af 100644
--- a/package/kernel/modules/netsupport.mk
+++ b/package/kernel/modules/netsupport.mk
@@ -863,3 +863,32 @@ endef
 
 $(eval $(call KernelPackage,slip))
 
+define KernelPackage/dnsresolver
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=In-kernel DNS Resolver
+  KCONFIG:= CONFIG_DNS_RESOLVER
+  FILES:=$(LINUX_DIR)/net/dns_resolver/dns_resolver.ko
+  AUTOLOAD:=$(call AutoLoad,30,dns_resolver)
+endef
+
+$(eval $(call KernelPackage,dnsresolver))
+
+define KernelPackage/rxrpc
+  SUBMENU:=$(NETWORK_SUPPORT_MENU)
+  TITLE:=AF_RXRPC support
+  KCONFIG:= \
+   CONFIG_AF_RXRPC \
+   CONFIG_RXKAD=m \
+   CONFIG_AF_RXRPC_DEBUG=n
+  FILES:= \
+   $(LINUX_DIR)/net/rxrpc/af-rxrpc.ko \
+   $(LINUX_DIR)/net/rxrpc/rxkad.ko
+  AUTOLOAD:=$(call AutoLoad,30,rxkad af-rxrpc)
+  DEPENDS:=+kmod-crypto-core +kmod-crypto-manager +kmod-crypto-pcbc 
+kmod-crypto-fcrypt
+endef
+
+define KernelPackage/rxrpc/description
+  Kernel support for AF_RXRPC; required for AFS client
+endef
+
+$(eval $(call KernelPackage,rxrpc))



pgpfofBqhmPsn.pgp
Description: PGP signature
___
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel