[PATCH] Staging: Westbridge: added ioremap_nocache instead of phys_to_virt
From: Sutharsan Ramamoorthy s...@cypress.com This patch removes phys_to_virt() and adds ioremap_nocache() for memory mapping the GPMC registers. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c linux-2.6.37-ptov/drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-ptov/drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c 2011-02-01 16:00:31.214861085 -0800 @@ -347,11 +347,8 @@ static int cy_as_hal_gpmc_init(void) u32 tmp32; int err; struct gpmc_timings timings; - /* -* get GPMC i/o registers base(already been i/o mapped -* in kernel, no need for separate i/o remap) -*/ - gpmc_base = phys_to_virt(OMAP34XX_GPMC_BASE); + + gpmc_base = (u32)ioremap_nocache(OMAP34XX_GPMC_BASE, BLKSZ_4K); DBGPRN(KERN_INFO kernel has gpmc_base=%x , val@ the base=%x, gpmc_base, __raw_readl(gpmc_base) ); -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Staging: Westbridge: fix EXPORT_SYMBOL errors reported by checkpatch.pl
On Mon, 2011-01-31 at 13:31 -0800, Greg KH wrote: On Tue, Jan 25, 2011 at 09:03:22PM -0800, Sutharsan wrote: From: Sutharsan Ramamoorthy s...@cypress.com This patch fixes errors reported by checkpatch.pl in westbridge device controller driver in the staging tree. File containing EXPORT_SYMBOL() macros for all the APIs exported by the westbridge software has been removed. EXPORT_SYMBOL() macros are added after the corresponding function definitions. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com I've already applied this patch, and you should have gotten the this patch has been applied email, right? So why was it resent? I resent adding '[PATCH]' tag which was missing in my first submission. Please ignore this. confused, greg k-h --- This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message. --- -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] Staging: Westbridge: fix EXPORT_SYMBOL errors reported by checkpatch.pl
On Mon, 2011-01-31 at 13:40 -0800, Greg KH wrote: On Wed, Jan 26, 2011 at 08:58:54AM -0800, Sutharsan wrote: From: Sutharsan Ramamoorthy s...@cypress.com This patch fixes errors reported by checkpatch.pl in westbridge device controller driver in the staging tree. File containing EXPORT_SYMBOL() macros for all the APIs exported by the westbridge software has been removed. EXPORT_SYMBOL() macros are added after the corresponding function definitions. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com Why was this sent again? totally confused, I apologize for resending and creating confusion. There has been a problem with the mail client. Please ignore this as well. greg k-h --- This message and any attachments may contain Cypress (or its subsidiaries) confidential information. If it has been received in error, please advise the sender and immediately delete this message. --- -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] Staging: Westbridge: fix EXPORT_SYMBOL errors reported by checkpatch.pl
From: Sutharsan Ramamoorthy s...@cypress.com This patch fixes errors reported by checkpatch.pl in westbridge device controller driver in the staging tree. File containing EXPORT_SYMBOL() macros for all the APIs exported by the westbridge software has been removed. EXPORT_SYMBOL() macros are added after the corresponding function definitions. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmisc.c linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmisc.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmisc.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmisc.c 2011-01-19 11:55:07.842669281 -0800 @@ -926,6 +926,8 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_get_firmware_version); + static cy_as_return_status_t my_handle_response_read_m_c_u_register(cy_as_device *dev_p, cy_as_ll_request_response *req_p, @@ -1115,7 +1117,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_read_m_c_u_register); cy_as_return_status_t cy_as_misc_write_m_c_u_register(cy_as_device_handle handle, @@ -1336,6 +1338,7 @@ cy_as_misc_reset(cy_as_device_handle han return ret; } +EXPORT_SYMBOL(cy_as_misc_reset); static cy_as_return_status_t get_unallocated_resource(cy_as_device *dev_p, cy_as_resource_type resource) @@ -1508,6 +1511,8 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_acquire_resource); + cy_as_return_status_t cy_as_misc_release_resource(cy_as_device_handle handle, cy_as_resource_type resource) @@ -1560,6 +1565,7 @@ cy_as_misc_release_resource(cy_as_device return CY_AS_ERROR_SUCCESS; } +EXPORT_SYMBOL(cy_as_misc_release_resource); cy_as_return_status_t cy_as_misc_set_trace_level(cy_as_device_handle handle, @@ -1718,6 +1724,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_heart_beat_control); static cy_as_return_status_t my_set_sd_clock_freq( @@ -1805,6 +1812,7 @@ cy_as_misc_set_low_speed_sd_freq( return my_set_sd_clock_freq(dev_p, 0, (uint8_t)setting, cb, client); } +EXPORT_SYMBOL(cy_as_misc_set_low_speed_sd_freq); cy_as_return_status_t cy_as_misc_set_high_speed_sd_freq( @@ -1830,6 +1838,7 @@ cy_as_misc_set_high_speed_sd_freq( return my_set_sd_clock_freq(dev_p, 1, (uint8_t)setting, cb, client); } +EXPORT_SYMBOL(cy_as_misc_set_high_speed_sd_freq); cy_as_return_status_t cy_as_misc_get_gpio_value(cy_as_device_handle handle, @@ -1921,7 +1930,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_get_gpio_value); cy_as_return_status_t cy_as_misc_set_gpio_value(cy_as_device_handle handle, @@ -2020,6 +2029,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_set_gpio_value); static cy_as_return_status_t my_enter_standby(cy_as_device *dev_p, cy_bool pin) @@ -2213,6 +2223,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_enter_standby); cy_as_return_status_t cy_as_misc_enter_standby_e_x_u(cy_as_device_handle handle, @@ -2425,6 +2436,7 @@ try_wakeup_again: return ret; } +EXPORT_SYMBOL(cy_as_misc_leave_standby); cy_as_return_status_t cy_as_misc_register_callback( @@ -2526,7 +2538,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_storage_changed); cy_as_return_status_t cy_as_misc_enter_suspend( @@ -2634,6 +2646,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_enter_suspend); cy_as_return_status_t cy_as_misc_leave_suspend( @@ -2704,6 +2717,7 @@ cy_as_misc_leave_suspend( return ret; } +EXPORT_SYMBOL(cy_as_misc_leave_suspend); cy_as_return_status_t cy_as_misc_reserve_l_n_a_boot_area(cy_as_device_handle handle, diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmtp.c linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmtp.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmtp.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmtp.c 2011-01-14 12:04:06.786111000 -0800 @@ -402,6 +402,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_mtp_start); static cy_as_return_status_t my_handle_response_mtp_stop(cy_as_device *dev_p, @@ -744,6 +745,7 @@ cy_as_mtp_init_send_object(cy_as_device_ client, CY_RQT_INIT_SEND_OBJECT); } +EXPORT_SYMBOL(cy_as_mtp_init_send_object); cy_as_return_status_t cy_as_mtp_init_get_object(cy_as_device_handle handle, @@ -763,6 +765,7 @@ cy_as_mtp_init_get_object(cy_as_device_h transaction_id, cb, client, CY_RQT_INIT_GET_OBJECT); } +EXPORT_SYMBOL(cy_as_mtp_init_get_object); static cy_as_return_status_t my_handle_response_cancel_send_object(cy_as_device *dev_p
Staging: Westbridge: fix EXPORT_SYMBOL errors reported by checkpatch.pl
From: Sutharsan Ramamoorthy s...@cypress.com This patch fixes errors reported by checkpatch.pl in westbridge device controller driver in the staging tree. File containing EXPORT_SYMBOL() macros for all the APIs exported by the westbridge software has been removed. EXPORT_SYMBOL() macros are added after the corresponding function definitions. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmisc.c linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmisc.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmisc.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmisc.c 2011-01-19 11:55:07.842669281 -0800 @@ -926,6 +926,8 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_get_firmware_version); + static cy_as_return_status_t my_handle_response_read_m_c_u_register(cy_as_device *dev_p, cy_as_ll_request_response *req_p, @@ -1115,7 +1117,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_read_m_c_u_register); cy_as_return_status_t cy_as_misc_write_m_c_u_register(cy_as_device_handle handle, @@ -1336,6 +1338,7 @@ cy_as_misc_reset(cy_as_device_handle han return ret; } +EXPORT_SYMBOL(cy_as_misc_reset); static cy_as_return_status_t get_unallocated_resource(cy_as_device *dev_p, cy_as_resource_type resource) @@ -1508,6 +1511,8 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_acquire_resource); + cy_as_return_status_t cy_as_misc_release_resource(cy_as_device_handle handle, cy_as_resource_type resource) @@ -1560,6 +1565,7 @@ cy_as_misc_release_resource(cy_as_device return CY_AS_ERROR_SUCCESS; } +EXPORT_SYMBOL(cy_as_misc_release_resource); cy_as_return_status_t cy_as_misc_set_trace_level(cy_as_device_handle handle, @@ -1718,6 +1724,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_heart_beat_control); static cy_as_return_status_t my_set_sd_clock_freq( @@ -1805,6 +1812,7 @@ cy_as_misc_set_low_speed_sd_freq( return my_set_sd_clock_freq(dev_p, 0, (uint8_t)setting, cb, client); } +EXPORT_SYMBOL(cy_as_misc_set_low_speed_sd_freq); cy_as_return_status_t cy_as_misc_set_high_speed_sd_freq( @@ -1830,6 +1838,7 @@ cy_as_misc_set_high_speed_sd_freq( return my_set_sd_clock_freq(dev_p, 1, (uint8_t)setting, cb, client); } +EXPORT_SYMBOL(cy_as_misc_set_high_speed_sd_freq); cy_as_return_status_t cy_as_misc_get_gpio_value(cy_as_device_handle handle, @@ -1921,7 +1930,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_get_gpio_value); cy_as_return_status_t cy_as_misc_set_gpio_value(cy_as_device_handle handle, @@ -2020,6 +2029,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_set_gpio_value); static cy_as_return_status_t my_enter_standby(cy_as_device *dev_p, cy_bool pin) @@ -2213,6 +2223,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_enter_standby); cy_as_return_status_t cy_as_misc_enter_standby_e_x_u(cy_as_device_handle handle, @@ -2425,6 +2436,7 @@ try_wakeup_again: return ret; } +EXPORT_SYMBOL(cy_as_misc_leave_standby); cy_as_return_status_t cy_as_misc_register_callback( @@ -2526,7 +2538,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_storage_changed); cy_as_return_status_t cy_as_misc_enter_suspend( @@ -2634,6 +2646,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_enter_suspend); cy_as_return_status_t cy_as_misc_leave_suspend( @@ -2704,6 +2717,7 @@ cy_as_misc_leave_suspend( return ret; } +EXPORT_SYMBOL(cy_as_misc_leave_suspend); cy_as_return_status_t cy_as_misc_reserve_l_n_a_boot_area(cy_as_device_handle handle, diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmtp.c linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmtp.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmtp.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmtp.c 2011-01-14 12:04:06.786111000 -0800 @@ -402,6 +402,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_mtp_start); static cy_as_return_status_t my_handle_response_mtp_stop(cy_as_device *dev_p, @@ -744,6 +745,7 @@ cy_as_mtp_init_send_object(cy_as_device_ client, CY_RQT_INIT_SEND_OBJECT); } +EXPORT_SYMBOL(cy_as_mtp_init_send_object); cy_as_return_status_t cy_as_mtp_init_get_object(cy_as_device_handle handle, @@ -763,6 +765,7 @@ cy_as_mtp_init_get_object(cy_as_device_h transaction_id, cb, client, CY_RQT_INIT_GET_OBJECT); } +EXPORT_SYMBOL(cy_as_mtp_init_get_object); static cy_as_return_status_t my_handle_response_cancel_send_object(cy_as_device *dev_p
[PATCH] Staging: Westbridge: fix EXPORT_SYMBOL errors reported by checkpatch.pl
From: Sutharsan Ramamoorthy s...@cypress.com This patch fixes errors reported by checkpatch.pl in westbridge device controller driver in the staging tree. File containing EXPORT_SYMBOL() macros for all the APIs exported by the westbridge software has been removed. EXPORT_SYMBOL() macros are added after the corresponding function definitions. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmisc.c linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmisc.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmisc.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmisc.c 2011-01-19 11:55:07.842669281 -0800 @@ -926,6 +926,8 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_get_firmware_version); + static cy_as_return_status_t my_handle_response_read_m_c_u_register(cy_as_device *dev_p, cy_as_ll_request_response *req_p, @@ -1115,7 +1117,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_read_m_c_u_register); cy_as_return_status_t cy_as_misc_write_m_c_u_register(cy_as_device_handle handle, @@ -1336,6 +1338,7 @@ cy_as_misc_reset(cy_as_device_handle han return ret; } +EXPORT_SYMBOL(cy_as_misc_reset); static cy_as_return_status_t get_unallocated_resource(cy_as_device *dev_p, cy_as_resource_type resource) @@ -1508,6 +1511,8 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_acquire_resource); + cy_as_return_status_t cy_as_misc_release_resource(cy_as_device_handle handle, cy_as_resource_type resource) @@ -1560,6 +1565,7 @@ cy_as_misc_release_resource(cy_as_device return CY_AS_ERROR_SUCCESS; } +EXPORT_SYMBOL(cy_as_misc_release_resource); cy_as_return_status_t cy_as_misc_set_trace_level(cy_as_device_handle handle, @@ -1718,6 +1724,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_heart_beat_control); static cy_as_return_status_t my_set_sd_clock_freq( @@ -1805,6 +1812,7 @@ cy_as_misc_set_low_speed_sd_freq( return my_set_sd_clock_freq(dev_p, 0, (uint8_t)setting, cb, client); } +EXPORT_SYMBOL(cy_as_misc_set_low_speed_sd_freq); cy_as_return_status_t cy_as_misc_set_high_speed_sd_freq( @@ -1830,6 +1838,7 @@ cy_as_misc_set_high_speed_sd_freq( return my_set_sd_clock_freq(dev_p, 1, (uint8_t)setting, cb, client); } +EXPORT_SYMBOL(cy_as_misc_set_high_speed_sd_freq); cy_as_return_status_t cy_as_misc_get_gpio_value(cy_as_device_handle handle, @@ -1921,7 +1930,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_get_gpio_value); cy_as_return_status_t cy_as_misc_set_gpio_value(cy_as_device_handle handle, @@ -2020,6 +2029,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_set_gpio_value); static cy_as_return_status_t my_enter_standby(cy_as_device *dev_p, cy_bool pin) @@ -2213,6 +2223,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_enter_standby); cy_as_return_status_t cy_as_misc_enter_standby_e_x_u(cy_as_device_handle handle, @@ -2425,6 +2436,7 @@ try_wakeup_again: return ret; } +EXPORT_SYMBOL(cy_as_misc_leave_standby); cy_as_return_status_t cy_as_misc_register_callback( @@ -2526,7 +2538,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_storage_changed); cy_as_return_status_t cy_as_misc_enter_suspend( @@ -2634,6 +2646,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_enter_suspend); cy_as_return_status_t cy_as_misc_leave_suspend( @@ -2704,6 +2717,7 @@ cy_as_misc_leave_suspend( return ret; } +EXPORT_SYMBOL(cy_as_misc_leave_suspend); cy_as_return_status_t cy_as_misc_reserve_l_n_a_boot_area(cy_as_device_handle handle, diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmtp.c linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmtp.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmtp.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmtp.c 2011-01-14 12:04:06.786111000 -0800 @@ -402,6 +402,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_mtp_start); static cy_as_return_status_t my_handle_response_mtp_stop(cy_as_device *dev_p, @@ -744,6 +745,7 @@ cy_as_mtp_init_send_object(cy_as_device_ client, CY_RQT_INIT_SEND_OBJECT); } +EXPORT_SYMBOL(cy_as_mtp_init_send_object); cy_as_return_status_t cy_as_mtp_init_get_object(cy_as_device_handle handle, @@ -763,6 +765,7 @@ cy_as_mtp_init_get_object(cy_as_device_h transaction_id, cb, client, CY_RQT_INIT_GET_OBJECT); } +EXPORT_SYMBOL(cy_as_mtp_init_get_object); static cy_as_return_status_t my_handle_response_cancel_send_object(cy_as_device *dev_p
[PATCH] Westbridge software module, fixes errors reported by checkpatch.pl
From: Sutharsan Ramamoorthy s...@cypress.com This patch fixes errors in westbridge device controller driver in the staging tree reported by checkpatch.pl. File containing EXPORT_SYMBOL() macros for all the APIs exported by the westbridge software has been removed. EXPORT_SYMBOL() macros are added after the corresponding function definitions. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmisc.c linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmisc.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmisc.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmisc.c 2011-01-19 11:55:07.842669281 -0800 @@ -926,6 +926,8 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_get_firmware_version); + static cy_as_return_status_t my_handle_response_read_m_c_u_register(cy_as_device *dev_p, cy_as_ll_request_response *req_p, @@ -1115,7 +1117,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_read_m_c_u_register); cy_as_return_status_t cy_as_misc_write_m_c_u_register(cy_as_device_handle handle, @@ -1336,6 +1338,7 @@ cy_as_misc_reset(cy_as_device_handle han return ret; } +EXPORT_SYMBOL(cy_as_misc_reset); static cy_as_return_status_t get_unallocated_resource(cy_as_device *dev_p, cy_as_resource_type resource) @@ -1508,6 +1511,8 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_acquire_resource); + cy_as_return_status_t cy_as_misc_release_resource(cy_as_device_handle handle, cy_as_resource_type resource) @@ -1560,6 +1565,7 @@ cy_as_misc_release_resource(cy_as_device return CY_AS_ERROR_SUCCESS; } +EXPORT_SYMBOL(cy_as_misc_release_resource); cy_as_return_status_t cy_as_misc_set_trace_level(cy_as_device_handle handle, @@ -1718,6 +1724,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_heart_beat_control); static cy_as_return_status_t my_set_sd_clock_freq( @@ -1805,6 +1812,7 @@ cy_as_misc_set_low_speed_sd_freq( return my_set_sd_clock_freq(dev_p, 0, (uint8_t)setting, cb, client); } +EXPORT_SYMBOL(cy_as_misc_set_low_speed_sd_freq); cy_as_return_status_t cy_as_misc_set_high_speed_sd_freq( @@ -1830,6 +1838,7 @@ cy_as_misc_set_high_speed_sd_freq( return my_set_sd_clock_freq(dev_p, 1, (uint8_t)setting, cb, client); } +EXPORT_SYMBOL(cy_as_misc_set_high_speed_sd_freq); cy_as_return_status_t cy_as_misc_get_gpio_value(cy_as_device_handle handle, @@ -1921,7 +1930,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_get_gpio_value); cy_as_return_status_t cy_as_misc_set_gpio_value(cy_as_device_handle handle, @@ -2020,6 +2029,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_set_gpio_value); static cy_as_return_status_t my_enter_standby(cy_as_device *dev_p, cy_bool pin) @@ -2213,6 +2223,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_enter_standby); cy_as_return_status_t cy_as_misc_enter_standby_e_x_u(cy_as_device_handle handle, @@ -2425,6 +2436,7 @@ try_wakeup_again: return ret; } +EXPORT_SYMBOL(cy_as_misc_leave_standby); cy_as_return_status_t cy_as_misc_register_callback( @@ -2526,7 +2538,7 @@ destroy: return ret; } - +EXPORT_SYMBOL(cy_as_misc_storage_changed); cy_as_return_status_t cy_as_misc_enter_suspend( @@ -2634,6 +2646,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_misc_enter_suspend); cy_as_return_status_t cy_as_misc_leave_suspend( @@ -2704,6 +2717,7 @@ cy_as_misc_leave_suspend( return ret; } +EXPORT_SYMBOL(cy_as_misc_leave_suspend); cy_as_return_status_t cy_as_misc_reserve_l_n_a_boot_area(cy_as_device_handle handle, diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmtp.c linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmtp.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/api/src/cyasmtp.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-wb/drivers/staging/westbridge/astoria/api/src/cyasmtp.c 2011-01-14 12:04:06.786111000 -0800 @@ -402,6 +402,7 @@ destroy: return ret; } +EXPORT_SYMBOL(cy_as_mtp_start); static cy_as_return_status_t my_handle_response_mtp_stop(cy_as_device *dev_p, @@ -744,6 +745,7 @@ cy_as_mtp_init_send_object(cy_as_device_ client, CY_RQT_INIT_SEND_OBJECT); } +EXPORT_SYMBOL(cy_as_mtp_init_send_object); cy_as_return_status_t cy_as_mtp_init_get_object(cy_as_device_handle handle, @@ -763,6 +765,7 @@ cy_as_mtp_init_get_object(cy_as_device_h transaction_id, cb, client, CY_RQT_INIT_GET_OBJECT); } +EXPORT_SYMBOL(cy_as_mtp_init_get_object); static cy_as_return_status_t my_handle_response_cancel_send_object(cy_as_device *dev_p, @@ -850,6 +853,7 @@ destroy: return ret; } +EXPORT_SYMBOL
[PATCH] adding gpmc configuration functions, west bridge related
This patch implements gpmc configuration functions needed by westbridge device controller driver in staging tree. These functions currently implemented in staging tree. This patch is part of the effort to bring westbridge device controller driver out of staging tree. Signed-off by: Sutharsan Ramamoorthy sutharsan.ramamoor...@yahoo.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/arch/arm/mach-omap2/board-zoom-peripherals.c linux-2.6.37-gpmc/arch/arm/mach-omap2/board-zoom-peripherals.c --- linux-2.6.37_vanilla/arch/arm/mach-omap2/board-zoom-peripherals.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-gpmc/arch/arm/mach-omap2/board-zoom-peripherals.c 2011-01-11 13:33:20.750681000 -0800 @@ -19,6 +19,7 @@ #include linux/regulator/fixed.h #include linux/wl12xx.h #include linux/mmc/host.h +#include linux/usb/cywb.h #include asm/mach-types.h #include asm/mach/arch.h @@ -348,6 +349,9 @@ void __init zoom_peripherals_init(void) omap_i2c_init(); platform_device_register(omap_vwlan_device); usb_musb_init(musb_board_data); +#ifdef CONFIG_WESTBRIDGE_ASTORIA + usb_cywb_init(); +#endif enable_board_wakeup_source(); omap_serial_init(); } diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/arch/arm/mach-omap2/Makefile linux-2.6.37-gpmc/arch/arm/mach-omap2/Makefile --- linux-2.6.37_vanilla/arch/arm/mach-omap2/Makefile 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-gpmc/arch/arm/mach-omap2/Makefile 2010-12-28 15:24:28.218691000 -0800 @@ -182,6 +182,7 @@ obj-y += $(usbfs-m) $(usbfs-y) obj-y += usb-musb.o obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o obj-y += usb-ehci.o +obj-$(CONFIG_WESTBRIDGE_ASTORIA)+= usb-cywb-pnand.o onenand-$(CONFIG_MTD_ONENAND_OMAP2):= gpmc-onenand.o obj-y += $(onenand-m) $(onenand-y) diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/arch/arm/mach-omap2/usb-cywb-pnand.c linux-2.6.37-gpmc/arch/arm/mach-omap2/usb-cywb-pnand.c --- linux-2.6.37_vanilla/arch/arm/mach-omap2/usb-cywb-pnand.c 1969-12-31 16:00:00.0 -0800 +++ linux-2.6.37-gpmc/arch/arm/mach-omap2/usb-cywb-pnand.c 2011-01-12 12:37:23.154716913 -0800 @@ -0,0 +1,171 @@ +/* + * linux /arch/arm/mach-omap2/usb-cywb-pnand.c + * + * Copyright (C) 2010 Cypress Semiconductor + * + * 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. + */ + +#include linux/module.h +#include linux/platform_device.h +#include linux/device.h +#include linux/usb/cywb.h +#include plat/gpmc.h + +/* + * chip select number on GPMC ( 0..7 ) + */ +#define AST_GPMC_CS 4 + +/* + * for use by gpmc_set_timings api, measured in ns, not clocks + */ +#define WB_GPMC_BUSCYC_T(7 * 6) +#define WB_GPMC_CS_T_O_N(0) +#define WB_GPMC_ADV_T_O_N (0) +#define WB_GPMC_OE_T_O_N(0) +#define WB_GPMC_OE_T_O_F_F (5 * 6) +#define WB_GPMC_WE_T_O_N(1 * 6) +#define WB_GPMC_WE_T_O_F_F (5 * 6) +#define WB_GPMC_RDS_ADJ (2 * 6) +#define WB_GPMC_RD_T_A_C_C (WB_GPMC_OE_T_O_F_F + WB_GPMC_RDS_ADJ) +#define WB_GPMC_WR_T_A_C_C (WB_GPMC_BUSCYC_T) + +#define AS_CS_MASK (0X7 8) +#define AS_CS_BADDR 0x02 +#define CSVALID_B (1 6) + +#define BLKSZ_4K 0x1000 + +/* + * switch GPMC DATA bus mode + */ +void cywb_gpmc_enable_16bit_bus(bool dbus16_enabled) +{ + u32 tmp32; + + /* +* disable gpmc CS4 operation 1st +*/ + tmp32 = gpmc_cs_read_reg(AST_GPMC_CS, + GPMC_CS_CONFIG7) ~GPMC_CONFIG7_CSVALID; + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, tmp32); + + /* +* GPMC NAND data bus can be 8 or 16 bit wide +*/ + if (dbus16_enabled) { + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, + (GPMC_CONFIG1_DEVICETYPE(2) | + GPMC_CONFIG1_WAIT_PIN_SEL(2) | + GPMC_CONFIG1_DEVICESIZE_16)); + } else { + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, + (GPMC_CONFIG1_DEVICETYPE(2) | + GPMC_CONFIG1_WAIT_PIN_SEL(2))); + } + + /* +* re-enable astoria CS operation on GPMC +*/ +gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, + (tmp32 | GPMC_CONFIG7_CSVALID)); +} + +int cywb_pnand_platform_retime() +{ + u32 tmp32; + struct gpmc_timings timings; + int retval = 0; + + + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, + (GPMC_CONFIG1_DEVICETYPE(2) | + GPMC_CONFIG1_WAIT_PIN_SEL(2
[PATCH] adding gpmc configuration functions, west bridge related
This patch adds and exports gpmc configuration functions. 'gpmc' configuration functions will be used by westbridge device controller driver in staging tree. This patch is part of the work to get westbridge device controller driver out of staging tree. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/arch/arm/mach-omap2/Makefile linux-2.6.37-cywb/arch/arm/mach-omap2/Makefile --- linux-2.6.37_vanilla/arch/arm/mach-omap2/Makefile 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-cywb/arch/arm/mach-omap2/Makefile 2010-12-13 16:04:08.378446603 -0800 @@ -182,6 +182,7 @@ obj-y += $(usbfs-m) $(usbfs-y) obj-y += usb-musb.o obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o obj-y += usb-ehci.o +obj-$(CONFIG_WESTBRIDGE_ASTORIA)+= usb-cywb-pnand.o onenand-$(CONFIG_MTD_ONENAND_OMAP2):= gpmc-onenand.o obj-y += $(onenand-m) $(onenand-y) diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/arch/arm/mach-omap2/usb-cywb-pnand.c linux-2.6.37-cywb/arch/arm/mach-omap2/usb-cywb-pnand.c --- linux-2.6.37_vanilla/arch/arm/mach-omap2/usb-cywb-pnand.c 1969-12-31 16:00:00.0 -0800 +++ linux-2.6.37-cywb/arch/arm/mach-omap2/usb-cywb-pnand.c 2010-12-20 17:33:23.822251855 -0800 @@ -0,0 +1,170 @@ +/* + * linux /arch/arm/mach-omap2/usb-cywb-pnand.c + * + * Copyright (C) 2010 Cypress Semiconductor + * + * 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. + */ + +#include linux/module.h + +#include plat/gpmc.h + +/* + * chip select number on GPMC ( 0..7 ) + */ +#define AST_GPMC_CS 4 + +/* + * for use by gpmc_set_timings api, measured in ns, not clocks + */ +#define WB_GPMC_BUSCYC_t(7 * 6) +#define WB_GPMC_CS_t_o_n(0) +#define WB_GPMC_ADV_t_o_n (0) +#define WB_GPMC_OE_t_o_n(0) +#define WB_GPMC_OE_t_o_f_f (5 * 6) +#define WB_GPMC_WE_t_o_n(1 * 6) +#define WB_GPMC_WE_t_o_f_f (5 * 6) +#define WB_GPMC_RDS_ADJ (2 * 6) +#define WB_GPMC_RD_t_a_c_c (WB_GPMC_OE_t_o_f_f + WB_GPMC_RDS_ADJ) +#define WB_GPMC_WR_t_a_c_c (WB_GPMC_BUSCYC_t) + +#define GPMC_16BIT_MODE 0 +#define GPMC_RETIME 1 + +/* + * GPMC_CONFIG7[cs] register bit fields + * AS_CS_MASK - 3 bit mask for A26,A25,A24, + * AS_CS_BADDR - 6 BIT VALUE A29 ...A24 + * CSVALID_B - CSVALID bit on GPMC_CONFIG7[cs] register + */ +#define AS_CS_MASK (0X7 8) +#define AS_CS_BADDR 0x02 +#define CSVALID_B (1 6) + +#define BLKSZ_4K 0x1000 + +/* + * switch GPMC DATA bus mode + */ +void cywb_gpmc_enable_16bit_bus(bool dbus16_enabled) +{ + u32 tmp32; + + /* +* disable gpmc CS4 operation 1st +*/ + tmp32 = gpmc_cs_read_reg(AST_GPMC_CS, + GPMC_CS_CONFIG7) ~GPMC_CONFIG7_CSVALID; + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, tmp32); + + /* +* GPMC NAND data bus can be 8 or 16 bit wide +*/ + if (dbus16_enabled) { + dev_dbg(KERN_INFO gpmc: enabling 16 bit bus\n); + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, + (GPMC_CONFIG1_DEVICETYPE(2) | + GPMC_CONFIG1_WAIT_PIN_SEL(2) | + GPMC_CONFIG1_DEVICESIZE_16)); + } else { + dev_dbg(KERN_INFO gpmc: enabling 8 bit bus\n); + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, + (GPMC_CONFIG1_DEVICETYPE(2) | + GPMC_CONFIG1_WAIT_PIN_SEL(2))); + } + + /* +* re-enable astoria CS operation on GPMC +*/ +gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, + (tmp32 | GPMC_CONFIG7_CSVALID)); +} + +int cywb_pnand_platform_retime(int action, bool dbus16_enabled) +{ + u32 tmp32; + struct gpmc_timings timings; + int retval; + + switch (action) { + + case GPMC_16BIT_MODE: + cywb_gpmc_enable_16bit_bus(dbus16_enabled); + retval = 0; + break; + case GPMC_RETIME: + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, + (GPMC_CONFIG1_DEVICETYPE(2) | + GPMC_CONFIG1_WAIT_PIN_SEL(2))); + + memset(timings, 0, sizeof(timings)); + + /* cs timing */ + timings.cs_on = WB_GPMC_CS_t_o_n; + timings.cs_wr_off = WB_GPMC_BUSCYC_t; + timings.cs_rd_off = WB_GPMC_BUSCYC_t; + + /* adv timing */ + timings.adv_on = WB_GPMC_ADV_t_o_n; + timings.adv_rd_off
[PATCH] adding gpmc configuration functions, west bridge related
This patch adds and exports gpmc configuration functions. 'gpmc' configuration functions will be used by westbridge device controller driver in staging tree. This patch is required to get westbridge device controller driver out of staging tree. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/arch/arm/mach-omap2/Makefile linux-2.6.37-cywb/arch/arm/mach-omap2/Makefile --- linux-2.6.37_vanilla/arch/arm/mach-omap2/Makefile 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-cywb/arch/arm/mach-omap2/Makefile 2010-12-13 16:04:08.378446603 -0800 @@ -182,6 +182,7 @@ obj-y += $(usbfs-m) $(usbfs-y) obj-y += usb-musb.o obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o obj-y += usb-ehci.o +obj-$(CONFIG_WESTBRIDGE_ASTORIA)+= usb-cywb-pnand.o onenand-$(CONFIG_MTD_ONENAND_OMAP2):= gpmc-onenand.o obj-y += $(onenand-m) $(onenand-y) diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/arch/arm/mach-omap2/usb-cywb-pnand.c linux-2.6.37-cywb/arch/arm/mach-omap2/usb-cywb-pnand.c --- linux-2.6.37_vanilla/arch/arm/mach-omap2/usb-cywb-pnand.c 1969-12-31 16:00:00.0 -0800 +++ linux-2.6.37-cywb/arch/arm/mach-omap2/usb-cywb-pnand.c 2010-12-14 15:51:13.710787480 -0800 @@ -0,0 +1,182 @@ +/* + * linux /arch/arm/mach-omap2/usb-cywb-pnand.c + * + * Copyright (C) 2010 Cypress Semiconductor + * + * 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., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include linux/module.h + +#include plat/gpmc.h + +/* + * chip select number on GPMC ( 0..7 ) + */ +#define AST_GPMC_CS 4 + +/* + * for use by gpmc_set_timings api, measured in ns, not clocks + */ +#define WB_GPMC_BUSCYC_t(7 * 6) +#define WB_GPMC_CS_t_o_n(0) +#define WB_GPMC_ADV_t_o_n (0) +#define WB_GPMC_OE_t_o_n(0) +#define WB_GPMC_OE_t_o_f_f (5 * 6) +#define WB_GPMC_WE_t_o_n(1 * 6) +#define WB_GPMC_WE_t_o_f_f (5 * 6) +#define WB_GPMC_RDS_ADJ (2 * 6) +#define WB_GPMC_RD_t_a_c_c (WB_GPMC_OE_t_o_f_f + WB_GPMC_RDS_ADJ) +#define WB_GPMC_WR_t_a_c_c (WB_GPMC_BUSCYC_t) + +#define GPMC_16BIT_MODE 0 +#define GPMC_RETIME 1 + +/* + * GPMC_CONFIG7[cs] register bit fields + * AS_CS_MASK - 3 bit mask for A26,A25,A24, + * AS_CS_BADDR - 6 BIT VALUE A29 ...A24 + * CSVALID_B - CSVALID bit on GPMC_CONFIG7[cs] register + */ +#define AS_CS_MASK (0X7 8) +#define AS_CS_BADDR 0x02 +#define CSVALID_B (1 6) + +#define BLKSZ_4K 0x1000 + +/* + * switch GPMC DATA bus mode + */ +void cywb_gpmc_enable_16bit_bus(bool dbus16_enabled) +{ + uint32_t tmp32; + + /* +* disable gpmc CS4 operation 1st +*/ + tmp32 = gpmc_cs_read_reg(AST_GPMC_CS, + GPMC_CS_CONFIG7) ~GPMC_CONFIG7_CSVALID; + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, tmp32); + + /* +* GPMC NAND data bus can be 8 or 16 bit wide +*/ + if (dbus16_enabled) { + printk(KERN_INFO enabling 16 bit bus\n); + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, + (GPMC_CONFIG1_DEVICETYPE(2) | + GPMC_CONFIG1_WAIT_PIN_SEL(2) | + GPMC_CONFIG1_DEVICESIZE_16) + ); + } else { + printk(KERN_INFO enabling 8 bit bus\n); + gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, + (GPMC_CONFIG1_DEVICETYPE(2) | + GPMC_CONFIG1_WAIT_PIN_SEL(2)) + ); + } + + /* +* re-enable astoria CS operation on GPMC +*/ +gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, + (tmp32 | GPMC_CONFIG7_CSVALID)); +} + +int cywb_pnand_platform_retime(int action, bool dbus16_enabled) +{ + u32 tmp32; + struct gpmc_timings timings; + int retval; + + switch (action) { + + case GPMC_16BIT_MODE: + cywb_gpmc_enable_16bit_bus(dbus16_enabled); + retval = 0; + break; + case GPMC_RETIME
[PATCH] west bridge device driver changes to use gpmc configuration functions
This patch contains changes to west bridge device controller driver in staging area. The west bridge device controller driver is modified to use gpmc configuration functions instead of directly modifying gpmc registers. This patch is continuation of David Cross' david.cr...@cypress.com earlier patch [PATCH] gpmc, EXPORT_SYMBOLS, west bridge related This patch depends on [PATCH] adding gpmc configuration functions, west bridge related. Thanks, Sutharsan. Signed-off-by: Sutharsan Ramamoorthy s...@cypress.com --- diff -uprN -X linux-2.6.37_vanilla/Documentation/dontdiff linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c linux-2.6.37-cywb/drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c --- linux-2.6.37_vanilla/drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c 2010-11-29 20:42:04.0 -0800 +++ linux-2.6.37-cywb/drivers/staging/westbridge/astoria/arch/arm/mach-omap2/cyashalomap_kernel.c 2010-12-14 15:37:02.770286377 -0800 @@ -129,6 +129,13 @@ static uint8_t pnand_16bit; #define PGMPAGE_B2 0x10 /* + * following macros are used in ./arch/arm/mach-omap2/usb-cywb-pnand.c + * so move them to common header + */ +#define GPMC_16BIT_MODE 0 +#define GPMC_RETIME 1 + +/* * The type of DMA operation, per endpoint */ typedef enum cy_as_hal_dma_type { @@ -303,55 +310,22 @@ static u16 omap_cfg_reg_L(u32 pad_func_i */ void cy_as_hal_gpmc_enable_16bit_bus(bool dbus16_enabled) { - uint32_t tmp32; - - /* -* disable gpmc CS4 operation 1st -*/ - tmp32 = gpmc_cs_read_reg(AST_GPMC_CS, - GPMC_CS_CONFIG7) ~GPMC_CONFIG7_CSVALID; - gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, tmp32); - - /* -* GPMC NAND data bus can be 8 or 16 bit wide -*/ - if (dbus16_enabled) { - DBGPRN(enabling 16 bit bus\n); - gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, - (GPMC_CONFIG1_DEVICETYPE(2) | - GPMC_CONFIG1_WAIT_PIN_SEL(2) | - GPMC_CONFIG1_DEVICESIZE_16) - ); - } else { - DBGPRN(KERN_INFO enabling 8 bit bus\n); - gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG1, - (GPMC_CONFIG1_DEVICETYPE(2) | - GPMC_CONFIG1_WAIT_PIN_SEL(2)) - ); - } - - /* -* re-enable astoria CS operation on GPMC -*/ -gpmc_cs_write_reg(AST_GPMC_CS, GPMC_CS_CONFIG7, - (tmp32 | GPMC_CONFIG7_CSVALID)); - /* *remember the state */ pnand_16bit = dbus16_enabled; + cywb_pnand_platform_retime(GPMC_16BIT_MODE, dbus16_enabled); } static int cy_as_hal_gpmc_init(void) { u32 tmp32; - int err; - struct gpmc_timings timings; + /* * get GPMC i/o registers base(already been i/o mapped * in kernel, no need for separate i/o remap) */ - gpmc_base = phys_to_virt(OMAP34XX_GPMC_BASE); + gpmc_base = (u32)ioremap_nocache(OMAP34XX_GPMC_BASE, BLKSZ_4K); DBGPRN(KERN_INFO kernel has gpmc_base=%x , val@ the base=%x, gpmc_base, __raw_readl(gpmc_base) ); @@ -363,109 +337,7 @@ static int cy_as_hal_gpmc_init(void) naddr_reg_vma = GPMC_VMA(AST_GPMC_NAND_ADDR); ndata_reg_vma = GPMC_VMA(AST_GPMC_NAND_DATA); - /* -* request GPMC CS for ASTORIA request -*/ - if (gpmc_cs_request(AST_GPMC_CS, SZ_16M, (void *)csa_phy) 0) { - cy_as_hal_print_message(KERN_ERR error failed to request - ncs4 for ASTORIA\n); - return -1; - } else { - DBGPRN(KERN_INFO got phy_addr:%x for - GPMC CS%d GPMC_CFGREG7[CS4]\n, -csa_phy, AST_GPMC_CS); - } - - /* -* request VM region for 4K addr space for chip select 4 phy address -* technically we don't need it for NAND devices, but do it anyway -* so that data read/write bus cycle can be triggered by reading -* or writing this mem region -*/ - if (!request_mem_region(csa_phy, BLKSZ_4K, AST_OMAP_HAL)) { - err = -EBUSY; - cy_as_hal_print_message(KERN_ERR error MEM region - request for phy_addr:%x failed\n, - csa_phy); - goto out_free_cs; - } - - /* -* REMAP mem region associated with our CS -*/ - gpmc_data_vma = (u32)ioremap_nocache(csa_phy, BLKSZ_4K); - if (!gpmc_data_vma) { - err = -ENOMEM; - cy_as_hal_print_message(KERN_ERR error- ioremap