Beispiel #1
0
static void sa1111_start_hc(struct sa1111_dev *dev)
{
	unsigned int usb_rst = 0;

	printk(KERN_DEBUG __FILE__
	       ": starting SA-1111 OHCI USB Controller\n");

#ifdef CONFIG_SA1100_BADGE4
	if (machine_is_badge4()) {
		badge4_set_5V(BADGE4_5V_USB, 1);
	}
#endif

	if (machine_is_xp860() ||
	    machine_has_neponset() ||
	    machine_is_pfs168() ||
	    machine_is_badge4())
		usb_rst = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW;

	/*
	 * Configure the power sense and control lines.  Place the USB
	 * host controller in reset.
	 */
	sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET,
		      dev->mapbase + SA1111_USB_RESET);

	/*
	 * Now, carefully enable the USB clock, and take
	 * the USB host controller out of reset.
	 */
	sa1111_enable_device(dev);
	udelay(11);
	sa1111_writel(usb_rst, dev->mapbase + SA1111_USB_RESET);
}
Beispiel #2
0
static void sa1111_start_hc(struct sa1111_dev *dev)
{
	unsigned int usb_rst = 0;

	printk(KERN_DEBUG __FILE__
	       ": starting SA-1111 OHCI USB Controller\n");

#ifdef CONFIG_SA1100_BADGE4
	if (machine_is_badge4()) {
		badge4_set_5V(BADGE4_5V_USB, 1);
	}
#endif

	if (machine_is_xp860() ||
	    machine_has_neponset() ||
	    machine_is_pfs168() ||
	    machine_is_badge4())
		usb_rst = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW;

	
	sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET,
		      dev->mapbase + SA1111_USB_RESET);

	
	sa1111_enable_device(dev);
	udelay(11);
	sa1111_writel(usb_rst, dev->mapbase + SA1111_USB_RESET);
}
Beispiel #3
0
static int __init
sa1100_leds_init(void)
{
    if (machine_is_assabet())
        leds_event = assabet_leds_event;
     if (machine_is_consus())
             leds_event = consus_leds_event;
    if (machine_is_badge4())
          leds_event = badge4_leds_event;
    if (machine_is_brutus())
        leds_event = brutus_leds_event;
    if (machine_is_cerf())
        leds_event = cerf_leds_event;
    if (machine_is_flexanet())
        leds_event = flexanet_leds_event;
    if (machine_is_graphicsclient())
        leds_event = graphicsclient_leds_event;
    if (machine_is_hackkit())
        leds_event = hackkit_leds_event;
    if (machine_is_lart())
        leds_event = lart_leds_event;
    if (machine_is_pfs168())
        leds_event = pfs168_leds_event;
    if (machine_is_graphicsmaster())
        leds_event = graphicsmaster_leds_event;
    if (machine_is_adsbitsy())
        leds_event = adsbitsy_leds_event;
    if (machine_is_pt_system3())
        leds_event = system3_leds_event;
    if (machine_is_simpad())
        leds_event = simpad_leds_event; /* what about machine registry? including led, apm... -zecke */

    leds_event(led_start);
    return 0;
}
Beispiel #4
0
static int __init
sa1100_leds_init(void)
{
	if (machine_is_assabet())
		leds_event = assabet_leds_event;
	if (machine_is_consus())
		leds_event = consus_leds_event;
	if (machine_is_badge4())
		leds_event = badge4_leds_event;
	if (machine_is_brutus())
		leds_event = brutus_leds_event;
	if (machine_is_cerf())
		leds_event = cerf_leds_event;
	if (machine_is_flexanet())
		leds_event = flexanet_leds_event;
	if (machine_is_graphicsclient())
		leds_event = graphicsclient_leds_event;
	if (machine_is_hackkit())
		leds_event = hackkit_leds_event;
	if (machine_is_lart())
		leds_event = lart_leds_event;
	if (machine_is_pfs168())
		leds_event = pfs168_leds_event;
	if (machine_is_graphicsmaster())
		leds_event = graphicsmaster_leds_event;
	if (machine_is_adsbitsy())
		leds_event = adsbitsy_leds_event;
	if (machine_is_pt_system3())
		leds_event = system3_leds_event;

	leds_event(led_start);
	return 0;
}
Beispiel #5
0
static void __exit sa1111_ohci_exit(void)
{
	hc_remove_ohci(sa1111_ohci);

	/*
	 * Put the USB host controller into reset.
	 */
	USB_RESET |= USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET;

	/*
	 * Stop the USB clock.
	 */
	SKPCR &= ~SKPCR_UCLKEN;

	/*
	 * Release memory resources.
	 */
//	release_mem_region(_USB_OHCI_OP_BASE, _USB_EXTENT);

#ifdef CONFIG_SA1100_BADGE4
	if (machine_is_badge4()) {
		badge4_set_5V(BADGE4_5V_USB, 0);
	}
#endif
}
Beispiel #6
0
static int __init sa1111_ohci_init(void)
{
	int ret;

	/*
	 * Request memory resources.
	 */
//	if (!request_mem_region(_USB_OHCI_OP_BASE, _USB_EXTENT, "usb-ohci"))
//		return -EBUSY;

	sa1111_ohci_configure();

	/*
	 * Initialise the generic OHCI driver.
	 */
	ret = hc_add_ohci(SA1111_FAKE_PCIDEV, NIRQHCIM,
			  (void *)&USB_OHCI_OP_BASE, 0, &sa1111_ohci,
			  "usb-ohci", "sa1111");

//	if (ret)
//		release_mem_region(_USB_OHCI_OP_BASE, _USB_EXTENT);

#ifdef CONFIG_SA1100_BADGE4
	if (machine_is_badge4() && (!ret)) {
		/* found the controller, so now power the bus */
		badge4_set_5V(BADGE4_5V_USB, 1);
	}
#endif

	return ret;
}
Beispiel #7
0
static void __init sa1111_ohci_configure(void)
{
	unsigned int usb_rst = 0;

	if (machine_is_xp860() ||
	    machine_has_neponset() ||
	    machine_is_accelent_sa() ||
	    machine_is_pfs168() ||
	    machine_is_badge4())
		usb_rst = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW;

	/*
	 * Configure the power sense and control lines.  Place the USB
	 * host controller in reset.
	 */
	USB_RESET = usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET;

	/*
	 * Now, carefully enable the USB clock, and take
	 * the USB host controller out of reset.
	 */
	SKPCR |= SKPCR_UCLKEN;
	udelay(11);
	USB_RESET = usb_rst;
}
Beispiel #8
0
static void sa1111_stop_hc(struct sa1111_dev *dev)
{
	unsigned int usb_rst;
	printk(KERN_DEBUG __FILE__
	       ": stopping SA-1111 OHCI USB Controller\n");

	/*
	 * Put the USB host controller into reset.
	 */
	usb_rst = sa1111_readl(dev->mapbase + SA1111_USB_RESET);
	sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET,
		      dev->mapbase + SA1111_USB_RESET);

	/*
	 * Stop the USB clock.
	 */
	sa1111_disable_device(dev);

#ifdef CONFIG_SA1100_BADGE4
	if (machine_is_badge4()) {
		/* Disable power to the USB bus */
		badge4_set_5V(BADGE4_5V_USB, 0);
	}
#endif
}
static int sa1111_start_hc(struct sa1111_dev *dev)
{
	unsigned int usb_rst = 0;
	int ret;

	dev_dbg(&dev->dev, "starting SA-1111 OHCI USB Controller\n");

	if (machine_is_xp860() ||
	    machine_has_neponset() ||
	    machine_is_pfs168() ||
	    machine_is_badge4())
		usb_rst = USB_RESET_PWRSENSELOW | USB_RESET_PWRCTRLLOW;

	/*
	 * Configure the power sense and control lines.  Place the USB
	 * host controller in reset.
	 */
	sa1111_writel(usb_rst | USB_RESET_FORCEIFRESET | USB_RESET_FORCEHCRESET,
		      dev->mapbase + USB_RESET);

	/*
	 * Now, carefully enable the USB clock, and take
	 * the USB host controller out of reset.
	 */
	ret = sa1111_enable_device(dev);
	if (ret == 0) {
		udelay(11);
		sa1111_writel(usb_rst, dev->mapbase + USB_RESET);
	}

	return ret;
}
Beispiel #10
0
static int pcmcia_probe(struct sa1111_dev *dev)
{
	void __iomem *base;
	int ret;

	ret = sa1111_enable_device(dev);
	if (ret)
		return ret;

	dev_set_drvdata(&dev->dev, NULL);

	if (!request_mem_region(dev->res.start, 512, SA1111_DRIVER_NAME(dev))) {
		sa1111_disable_device(dev);
		return -EBUSY;
	}

	base = dev->mapbase;

	/*
	 * Initialise the suspend state.
	 */
	writel_relaxed(PCSSR_S0_SLEEP | PCSSR_S1_SLEEP, base + PCSSR);
	writel_relaxed(PCCR_S0_FLT | PCCR_S1_FLT, base + PCCR);

	ret = -ENODEV;
#ifdef CONFIG_SA1100_BADGE4
	if (machine_is_badge4())
		ret = pcmcia_badge4_init(dev);
#endif
#ifdef CONFIG_SA1100_JORNADA720
	if (machine_is_jornada720())
		ret = pcmcia_jornada720_init(dev);
#endif
#ifdef CONFIG_ARCH_LUBBOCK
	if (machine_is_lubbock())
		ret = pcmcia_lubbock_init(dev);
#endif
#ifdef CONFIG_ASSABET_NEPONSET
	if (machine_is_assabet())
		ret = pcmcia_neponset_init(dev);
#endif

	if (ret) {
		release_mem_region(dev->res.start, 512);
		sa1111_disable_device(dev);
	}

	return ret;
}
Beispiel #11
0
int pcmcia_badge4_init(struct device *dev)
{
	int ret = -ENODEV;

	if (machine_is_badge4()) {
		printk(KERN_INFO
		       "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n",
		       __func__,
		       badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc);

		ret = sa11xx_drv_pcmcia_probe(dev, &badge4_pcmcia_ops, 0, 2);
	}

	return ret;
}
Beispiel #12
0
int pcmcia_badge4_init(struct sa1111_dev *dev)
{
	int ret = -ENODEV;

	if (machine_is_badge4()) {
		printk(KERN_INFO
		       "%s: badge4_pcmvcc=%d, badge4_pcmvpp=%d, badge4_cfvcc=%d\n",
		       __func__,
		       badge4_pcmvcc, badge4_pcmvpp, badge4_cfvcc);

		sa11xx_drv_pcmcia_ops(&badge4_pcmcia_ops);
		ret = sa1111_pcmcia_add(dev, &badge4_pcmcia_ops,
				sa11xx_drv_pcmcia_add_one);
	}

	return ret;
}
static int __init badge4_init(void)
{
	int ret;

	if (!machine_is_badge4())
		return -ENODEV;

	/* LCD */
	GPCR  = (BADGE4_GPIO_LGP2 | BADGE4_GPIO_LGP3 |
		 BADGE4_GPIO_LGP4 | BADGE4_GPIO_LGP5 |
		 BADGE4_GPIO_LGP6 | BADGE4_GPIO_LGP7 |
		 BADGE4_GPIO_LGP8 | BADGE4_GPIO_LGP9 |
		 BADGE4_GPIO_GPA_VID | BADGE4_GPIO_GPB_VID |
		 BADGE4_GPIO_GPC_VID);
	GPDR &= ~BADGE4_GPIO_INT_VID;
	GPDR |= (BADGE4_GPIO_LGP2 | BADGE4_GPIO_LGP3 |
		 BADGE4_GPIO_LGP4 | BADGE4_GPIO_LGP5 |
		 BADGE4_GPIO_LGP6 | BADGE4_GPIO_LGP7 |
		 BADGE4_GPIO_LGP8 | BADGE4_GPIO_LGP9 |
		 BADGE4_GPIO_GPA_VID | BADGE4_GPIO_GPB_VID |
		 BADGE4_GPIO_GPC_VID);

	/* SDRAM SPD i2c */
	GPCR  = (BADGE4_GPIO_SDSDA | BADGE4_GPIO_SDSCL);
	GPDR |= (BADGE4_GPIO_SDSDA | BADGE4_GPIO_SDSCL);

	/* uart */
	GPCR  = (BADGE4_GPIO_UART_HS1 | BADGE4_GPIO_UART_HS2);
	GPDR |= (BADGE4_GPIO_UART_HS1 | BADGE4_GPIO_UART_HS2);

	/* CPLD muxsel0 input for mux/adc chip select */
	GPCR  = BADGE4_GPIO_MUXSEL0;
	GPDR |= BADGE4_GPIO_MUXSEL0;

	/* test points: J5, J6 as inputs, J7 outputs */
	GPDR &= ~(BADGE4_GPIO_TESTPT_J5 | BADGE4_GPIO_TESTPT_J6);
	GPCR  = BADGE4_GPIO_TESTPT_J7;
	GPDR |= BADGE4_GPIO_TESTPT_J7;

	/* 5V supply rail. */
	GPCR  = BADGE4_GPIO_PCMEN5V;		/* initially off */
	GPDR |= BADGE4_GPIO_PCMEN5V;

	/* CPLD sdram type inputs; set up by blob */
	//GPDR |= (BADGE4_GPIO_SDTYP1 | BADGE4_GPIO_SDTYP0);
	printk(KERN_DEBUG __FILE__ ": SDRAM CPLD typ1=%d typ0=%d\n",
		!!(GPLR & BADGE4_GPIO_SDTYP1),
		!!(GPLR & BADGE4_GPIO_SDTYP0));

	/* SA1111 reset pin; set up by blob */
	//GPSR  = BADGE4_GPIO_SA1111_NRST;
	//GPDR |= BADGE4_GPIO_SA1111_NRST;


	/* power management cruft */
	PGSR = 0;
	PWER = 0;
	PCFR = 0;
	PSDR = 0;

	PWER |= PWER_GPIO26;	/* wake up on an edge from TESTPT_J5 */
	PWER |= PWER_RTC;	/* wake up if rtc fires */

	/* drive sa1111_nrst during sleep */
	PGSR |= BADGE4_GPIO_SA1111_NRST;
	/* drive CPLD as is during sleep */
	PGSR |= (GPLR & (BADGE4_GPIO_SDTYP0|BADGE4_GPIO_SDTYP1));


	/* Now bring up the SA-1111. */
	ret = badge4_sa1111_init();
	if (ret < 0)
		printk(KERN_ERR
			"%s: SA-1111 initialization failed (%d)\n",
			__func__, ret);


	/* maybe turn on 5v0 from the start */
	badge4_set_5V(BADGE4_5V_INITIALLY, five_v_on);

	sa11x0_register_mtd(&badge4_flash_data, &badge4_flash_resource, 1);

	return 0;
}
static int __init sa1100_pcmcia_machine_init(void)
{
#ifdef CONFIG_SA1100_ASSABET
  if(machine_is_assabet()) {
    if(machine_has_neponset()) {
#ifdef CONFIG_ASSABET_NEPONSET
      pcmcia_low_level = &neponset_pcmcia_ops;
#else
      printk(KERN_ERR "Card Services disabled: missing Neponset support\n");
      return -1;
#endif
    } else
      pcmcia_low_level = &assabet_pcmcia_ops;
  }
#endif
#ifdef CONFIG_SA1100_BADGE4
  if (machine_is_badge4())
    pcmcia_low_level = &badge4_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_FREEBIRD
  if (machine_is_freebird())
    pcmcia_low_level = &freebird_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_H3600
  if (machine_is_h3600())
    pcmcia_low_level = &h3600_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_CERF
  if (machine_is_cerf())
    pcmcia_low_level = &cerf_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_GRAPHICSCLIENT
  if (machine_is_graphicsclient())
    pcmcia_low_level = &gcplus_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_XP860
  if (machine_is_xp860())
    pcmcia_low_level = &xp860_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_YOPY
  if (machine_is_yopy())
    pcmcia_low_level = &yopy_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_SHANNON
  if (machine_is_shannon())
    pcmcia_low_level = &shannon_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_PANGOLIN
  if (machine_is_pangolin())
    pcmcia_low_level = &pangolin_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_JORNADA720
  if (machine_is_jornada720())
    pcmcia_low_level = &jornada720_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_PFS168
  if(machine_is_pfs168())
    pcmcia_low_level = &pfs168_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_FLEXANET
  if(machine_is_flexanet())
    pcmcia_low_level = &flexanet_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_SIMPAD
  if(machine_is_simpad())
    pcmcia_low_level = &simpad_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_GRAPHICSMASTER
  if(machine_is_graphicsmaster())
    pcmcia_low_level = &graphicsmaster_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_ADSAGC
  if(machine_is_adsagc())
    pcmcia_low_level = &graphicsmaster_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_ADSBITSY
  if(machine_is_adsbitsy())
    pcmcia_low_level = &adsbitsy_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_ADSBITSYPLUS
  if(machine_is_adsbitsyplus())
    pcmcia_low_level = &adsbitsyplus_pcmcia_ops;
#endif
#ifdef CONFIG_SA1100_STORK
  if(machine_is_stork())
    pcmcia_low_level = &stork_pcmcia_ops;
#endif

  if (!pcmcia_low_level) {
    printk(KERN_ERR "This hardware is not supported by the SA1100 Card Service driver\n");
    return -ENODEV;
  }

  return 0;
}
static int __init sa1100_static_partitions(struct mtd_partition **parts)
{
	int nb_parts = 0;

#ifdef CONFIG_SA1100_ADSBITSY
	if (machine_is_adsbitsy()) {
		*parts       = adsbitsy_partitions;
		nb_parts     = ARRAY_SIZE(adsbitsy_partitions);
	}
#endif
#ifdef CONFIG_SA1100_ASSABET
	if (machine_is_assabet()) {
		*parts       = assabet_partitions;
		nb_parts     = ARRAY_SIZE(assabet_partitions);
	}
#endif
#ifdef CONFIG_SA1100_BADGE4
	if (machine_is_badge4()) {
		*parts       = badge4_partitions;
		nb_parts     = ARRAY_SIZE(badge4_partitions);
	}
#endif
#ifdef CONFIG_SA1100_CERF
	if (machine_is_cerf()) {
		*parts       = cerf_partitions;
		nb_parts     = ARRAY_SIZE(cerf_partitions);
	}
#endif
#ifdef CONFIG_SA1100_CONSUS
	if (machine_is_consus()) {
		*parts       = consus_partitions;
		nb_parts     = ARRAY_SIZE(consus_partitions);
	}
#endif
#ifdef CONFIG_SA1100_FLEXANET
	if (machine_is_flexanet()) {
		*parts       = flexanet_partitions;
		nb_parts     = ARRAY_SIZE(flexanet_partitions);
	}
#endif
#ifdef CONFIG_SA1100_FREEBIRD
	if (machine_is_freebird()) {
		*parts       = freebird_partitions;
		nb_parts     = ARRAY_SIZE(freebird_partitions);
	}
#endif
#ifdef CONFIG_SA1100_FRODO
	if (machine_is_frodo()) {
		*parts       = frodo_partitions;
		nb_parts     = ARRAY_SIZE(frodo_partitions);
	}
#endif	
#ifdef CONFIG_SA1100_GRAPHICSCLIENT
	if (machine_is_graphicsclient()) {
		*parts       = graphicsclient_partitions;
		nb_parts     = ARRAY_SIZE(graphicsclient_partitions);
	}
#endif
#ifdef CONFIG_SA1100_GRAPHICSMASTER
	if (machine_is_graphicsmaster()) {
		*parts       = graphicsmaster_partitions;
		nb_parts     = ARRAY_SIZE(graphicsmaster_partitions);
	}
#endif
#ifdef CONFIG_SA1100_H3XXX
	if (machine_is_h3xxx()) {
		*parts       = h3xxx_partitions;
		nb_parts     = ARRAY_SIZE(h3xxx_partitions);
	}
#endif
#ifdef CONFIG_SA1100_HACKKIT
	if (machine_is_hackkit()) {
		*parts = hackkit_partitions;
		nb_parts = ARRAY_SIZE(hackkit_partitions);
	}
#endif
#ifdef CONFIG_SA1100_HUW_WEBPANEL
	if (machine_is_huw_webpanel()) {
		*parts       = huw_webpanel_partitions;
		nb_parts     = ARRAY_SIZE(huw_webpanel_partitions);
	}
#endif
#ifdef CONFIG_SA1100_JORNADA720
	if (machine_is_jornada720()) {
		*parts       = jornada720_partitions;
		nb_parts     = ARRAY_SIZE(jornada720_partitions);
	}
#endif
#ifdef CONFIG_SA1100_PANGOLIN
	if (machine_is_pangolin()) {
		*parts       = pangolin_partitions;
		nb_parts     = ARRAY_SIZE(pangolin_partitions);
	}
#endif
#ifdef CONFIG_SA1100_PT_SYSTEM3
	if (machine_is_pt_system3()) {
		*parts       = system3_partitions;
		nb_parts     = ARRAY_SIZE(system3_partitions);
	}
#endif
#ifdef CONFIG_SA1100_SHANNON
	if (machine_is_shannon()) {
		*parts       = shannon_partitions;
		nb_parts     = ARRAY_SIZE(shannon_partitions);
	}
#endif
#ifdef CONFIG_SA1100_SHERMAN
	if (machine_is_sherman()) {
		*parts       = sherman_partitions;
		nb_parts     = ARRAY_SIZE(sherman_partitions);
	}
#endif
#ifdef CONFIG_SA1100_SIMPAD
	if (machine_is_simpad()) {
		*parts       = simpad_partitions;
		nb_parts     = ARRAY_SIZE(simpad_partitions);
	}
#endif
#ifdef CONFIG_SA1100_STORK
	if (machine_is_stork()) {
		*parts       = stork_partitions;
		nb_parts     = ARRAY_SIZE(stork_partitions);
	}
#endif
#ifdef CONFIG_SA1100_TRIZEPS
	if (machine_is_trizeps()) {
		*parts       = trizeps_partitions;
		nb_parts     = ARRAY_SIZE(trizeps_partitions);
	}
#endif
#ifdef CONFIG_SA1100_YOPY
	if (machine_is_yopy()) {
		*parts       = yopy_partitions;
		nb_parts     = ARRAY_SIZE(yopy_partitions);
	}
#endif

	return nb_parts;
}