From patchwork Mon Jul 6 08:31:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 491481 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2D28D140779 for ; Mon, 6 Jul 2015 18:32:17 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=Cu82oKeY; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 688624B67F; Mon, 6 Jul 2015 10:32:15 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tQtbvChKvxaO; Mon, 6 Jul 2015 10:32:15 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AF19B4B66A; Mon, 6 Jul 2015 10:32:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A717F4B66A for ; Mon, 6 Jul 2015 10:32:10 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JkcHTgqlBztj for ; Mon, 6 Jul 2015 10:32:10 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-qk0-f180.google.com (mail-qk0-f180.google.com [209.85.220.180]) by theia.denx.de (Postfix) with ESMTPS id 15A284B68A for ; Mon, 6 Jul 2015 10:32:06 +0200 (CEST) Received: by qkei195 with SMTP id i195so112392559qke.3 for ; Mon, 06 Jul 2015 01:32:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:subject:date:in-reply-to:references:mime-version :content-type; bh=qVoul5krqjFJkYyKGSXKiBZIFrN1aIR1FQ7BXFgOk/E=; b=Cu82oKeYt1D6gQkrvgQgnazXgHqDJcgc5Q60TiKVEVrot+EKRXM8kfWQO9qZNxis9f 7h1pOo+H64d5TU24ARRzyBxjKbWZlkE8iUn+xM6tXAAz/HVQhdUDy0bTZAwI5wFcPtzr A8pSQnISFVMTxIMIojYR9x+t99tlOGrIlfBtzoFeTmLE6DeTD3NU1mDhnbD4lL99fW3v /svEKYRDaw54M4PyCu0qaVB4m5/fIBRruFx48RXBar9kUD8JVZFLSxR8mjb606Sxh0+L YwcxKG7kcmZY+9HbJQePwt41auwTrh998KV2wEHlSJm0An007+jGSy0ZIMwQZC5uyTwB tqKg== X-Received: by 10.140.201.80 with SMTP id w77mr73696892qha.33.1436171525187; Mon, 06 Jul 2015 01:32:05 -0700 (PDT) Received: from mail.hotmail.com (blu004-wss1s1.hotmail.com. [134.170.2.216]) by mx.google.com with ESMTPSA id p85sm8886568qkh.10.2015.07.06.01.32.04 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 06 Jul 2015 01:32:04 -0700 (PDT) Received: from BLU436-SMTP13 ([134.170.2.215]) by BLU004-WSS1S1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 6 Jul 2015 01:32:03 -0700 X-TMN: [NAtSN4CaR9Vu6CC4KuOYT2hn/Ext40sP] Message-ID: From: Bin Meng To: Simon Glass , U-Boot Mailing List , Jian Luo Date: Mon, 6 Jul 2015 16:31:26 +0800 X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1436171496-20495-1-git-send-email-bmeng.cn@gmail.com> References: <1436171496-20495-1-git-send-email-bmeng.cn@gmail.com> X-OriginalArrivalTime: 06 Jul 2015 08:31:57.0456 (UTC) FILETIME=[3896D100:01D0B7C6] MIME-Version: 1.0 Subject: [U-Boot] [PATCH v2 01/11] video: vesa_fb: Look up VGA device by class instead of id X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Per PCI spec, VGA device reports its class as standard 030000h in its configuration space, so we can use it to determine if we need run option rom instead of testing the supported vendor/device ids. Signed-off-by: Bin Meng Acked-by: Simon Glass --- Changes in v2: None drivers/video/vesa_fb.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/video/vesa_fb.c b/drivers/video/vesa_fb.c index 47f824a..909f8e8 100644 --- a/drivers/video/vesa_fb.c +++ b/drivers/video/vesa_fb.c @@ -1,6 +1,5 @@ /* - * - * Vesa frame buffer driver for x86 + * VESA frame buffer driver * * Copyright (C) 2014 Google, Inc * @@ -17,16 +16,6 @@ */ GraphicDevice ctfb; -/* Devices to allow - only the last one works fully */ -struct pci_device_id vesa_video_ids[] = { - { .vendor = 0x102b, .device = 0x0525 }, - { .vendor = 0x1002, .device = 0x5159 }, - { .vendor = 0x1002, .device = 0x4752 }, - { .vendor = 0x1002, .device = 0x5452 }, - { .vendor = 0x8086, .device = 0x0f31 }, - {}, -}; - void *video_hw_init(void) { GraphicDevice *gdev = &ctfb; @@ -36,8 +25,7 @@ void *video_hw_init(void) printf("Video: "); if (vbe_get_video_info(gdev)) { - /* TODO: Should we look these up by class? */ - dev = pci_find_devices(vesa_video_ids, 0); + dev = pci_find_class(PCI_CLASS_DISPLAY_VGA << 8, 0); if (dev == -1) { printf("no card detected\n"); return NULL;