diff options
Diffstat (limited to 'drivers/staging/vc04_services/interface/vchiq_arm')
5 files changed, 35 insertions, 135 deletions
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c index e76720903064..83d740feab96 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c @@ -109,7 +109,8 @@ free_pagelist(struct vchiq_pagelist_info *pagelistinfo, int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) { struct device *dev = &pdev->dev; - struct rpi_firmware *fw = platform_get_drvdata(pdev); + struct vchiq_drvdata *drvdata = platform_get_drvdata(pdev); + struct rpi_firmware *fw = drvdata->fw; VCHIQ_SLOT_ZERO_T *vchiq_slot_zero; struct resource *res; void *slot_mem; @@ -127,6 +128,7 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state) if (err < 0) return err; + g_cache_line_size = drvdata->cache_line_size; g_fragments_size = 2 * g_cache_line_size; /* Allocate space for the channels in coherent memory */ diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c index bc05c69383b8..ea789376de0f 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -170,6 +170,14 @@ static struct device *vchiq_dev; static DEFINE_SPINLOCK(msg_queue_spinlock); static struct platform_device *bcm2835_camera; +static struct vchiq_drvdata bcm2835_drvdata = { + .cache_line_size = 32, +}; + +static struct vchiq_drvdata bcm2836_drvdata = { + .cache_line_size = 64, +}; + static const char *const ioctl_names[] = { "CONNECT", "SHUTDOWN", @@ -3573,12 +3581,25 @@ void vchiq_platform_conn_state_changed(VCHIQ_STATE_T *state, } } +static const struct of_device_id vchiq_of_match[] = { + { .compatible = "brcm,bcm2835-vchiq", .data = &bcm2835_drvdata }, + { .compatible = "brcm,bcm2836-vchiq", .data = &bcm2836_drvdata }, + {}, +}; +MODULE_DEVICE_TABLE(of, vchiq_of_match); + static int vchiq_probe(struct platform_device *pdev) { struct device_node *fw_node; - struct rpi_firmware *fw; + const struct of_device_id *of_id; + struct vchiq_drvdata *drvdata; int err; + of_id = of_match_node(vchiq_of_match, pdev->dev.of_node); + drvdata = (struct vchiq_drvdata *)of_id->data; + if (!drvdata) + return -EINVAL; + fw_node = of_find_compatible_node(NULL, NULL, "raspberrypi,bcm2835-firmware"); if (!fw_node) { @@ -3586,12 +3607,12 @@ static int vchiq_probe(struct platform_device *pdev) return -ENOENT; } - fw = rpi_firmware_get(fw_node); + drvdata->fw = rpi_firmware_get(fw_node); of_node_put(fw_node); - if (!fw) + if (!drvdata->fw) return -EPROBE_DEFER; - platform_set_drvdata(pdev, fw); + platform_set_drvdata(pdev, drvdata); err = vchiq_platform_init(pdev, &g_state); if (err != 0) @@ -3661,12 +3682,6 @@ static int vchiq_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id vchiq_of_match[] = { - { .compatible = "brcm,bcm2835-vchiq", }, - {}, -}; -MODULE_DEVICE_TABLE(of, vchiq_of_match); - static struct platform_driver vchiq_driver = { .driver = { .name = "bcm2835_vchiq", diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h index 40bb0c63b1a9..2f3ebc99cbcf 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -123,6 +123,11 @@ typedef struct vchiq_arm_state_struct { } VCHIQ_ARM_STATE_T; +struct vchiq_drvdata { + const unsigned int cache_line_size; + struct rpi_firmware *fw; +}; + extern int vchiq_arm_log_level; extern int vchiq_susp_log_level; diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_genversion b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_genversion deleted file mode 100644 index dd1f324a8654..000000000000 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_genversion +++ /dev/null @@ -1,88 +0,0 @@ -#!/usr/bin/perl -w -# SPDX-License-Identifier: GPL-2.0 - -use strict; - -# -# Generate a version from available information -# - -my $prefix = shift @ARGV; -my $root = shift @ARGV; - - -if ( not defined $root ) { - die "usage: $0 prefix root-dir\n"; -} - -if ( ! -d $root ) { - die "root directory $root not found\n"; -} - -my $version = "unknown"; -my $tainted = ""; - -if ( -d "$root/.git" ) { - # attempt to work out git version. only do so - # on a linux build host, as cygwin builds are - # already slow enough - - if ( -f "/usr/bin/git" || -f "/usr/local/bin/git" ) { - if (not open(F, "git --git-dir $root/.git rev-parse --verify HEAD|")) { - $version = "no git version"; - } - else { - $version = <F>; - $version =~ s/[ \r\n]*$//; # chomp may not be enough (cygwin). - $version =~ s/^[ \r\n]*//; # chomp may not be enough (cygwin). - } - - if (open(G, "git --git-dir $root/.git status --porcelain|")) { - $tainted = <G>; - $tainted =~ s/[ \r\n]*$//; # chomp may not be enough (cygwin). - $tainted =~ s/^[ \r\n]*//; # chomp may not be enough (cygwin). - if (length $tainted) { - $version = join ' ', $version, "(tainted)"; - } - else { - $version = join ' ', $version, "(clean)"; - } - } - } -} - -my $hostname = `hostname`; -$hostname =~ s/[ \r\n]*$//; # chomp may not be enough (cygwin). -$hostname =~ s/^[ \r\n]*//; # chomp may not be enough (cygwin). - - -print STDERR "Version $version\n"; -print <<EOF; -#include "${prefix}_build_info.h" -#include <linux/broadcom/vc_debug_sym.h> - -VC_DEBUG_DECLARE_STRING_VAR( ${prefix}_build_hostname, "$hostname" ); -VC_DEBUG_DECLARE_STRING_VAR( ${prefix}_build_version, "$version" ); -VC_DEBUG_DECLARE_STRING_VAR( ${prefix}_build_time, __TIME__ ); -VC_DEBUG_DECLARE_STRING_VAR( ${prefix}_build_date, __DATE__ ); - -const char *vchiq_get_build_hostname( void ) -{ - return vchiq_build_hostname; -} - -const char *vchiq_get_build_version( void ) -{ - return vchiq_build_version; -} - -const char *vchiq_get_build_date( void ) -{ - return vchiq_build_date; -} - -const char *vchiq_get_build_time( void ) -{ - return vchiq_build_time; -} -EOF diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c index dddc828390d0..c3223fcdaf87 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_shim.c @@ -50,33 +50,6 @@ struct shim_service { void *callback_param; }; -/* ---------------------------------------------------------------------- - * return pointer to the mphi message driver function table - * -------------------------------------------------------------------- */ -const VCHI_MESSAGE_DRIVER_T * -vchi_mphi_message_driver_func_table(void) -{ - return NULL; -} - -/* ---------------------------------------------------------------------- - * return a pointer to the 'single' connection driver fops - * -------------------------------------------------------------------- */ -const VCHI_CONNECTION_API_T * -single_get_func_table(void) -{ - return NULL; -} - -VCHI_CONNECTION_T *vchi_create_connection( - const VCHI_CONNECTION_API_T *function_table, - const VCHI_MESSAGE_DRIVER_T *low_level) -{ - (void)function_table; - (void)low_level; - return NULL; -} - /*********************************************************** * Name: vchi_msg_peek * @@ -517,9 +490,7 @@ EXPORT_SYMBOL(vchi_initialise); /*********************************************************** * Name: vchi_connect * - * Arguments: VCHI_CONNECTION_T **connections - * const uint32_t num_connections - * VCHI_INSTANCE_T instance_handle) + * Arguments: VCHI_INSTANCE_T instance_handle * * Description: Starts the command service on each connection, * causing INIT messages to be pinged back and forth @@ -527,15 +498,10 @@ EXPORT_SYMBOL(vchi_initialise); * Returns: 0 if successful, failure otherwise * ***********************************************************/ -int32_t vchi_connect(VCHI_CONNECTION_T **connections, - const uint32_t num_connections, - VCHI_INSTANCE_T instance_handle) +int32_t vchi_connect(VCHI_INSTANCE_T instance_handle) { VCHIQ_INSTANCE_T instance = (VCHIQ_INSTANCE_T)instance_handle; - (void)connections; - (void)num_connections; - return vchiq_connect(instance); } EXPORT_SYMBOL(vchi_connect); |